GithubHelp home page GithubHelp logo

Comments (2)

clemp avatar clemp commented on August 12, 2024

MATCH (d:Entity {name:$name})
OPTIONAL MATCH (d)-[:HAS_PROPOSAL]->(:Proposal)<-[:VOTED]-(sm:Wallet)
WITH d, COUNT(DISTINCT sm) as snapshot_members
OPTIONAL MATCH (d)<-[:IS_MEMBER]-(dm:Member)
WITH d, snapshot_members, COUNT(DISTINCT dm) as DAOHaus_members
RETURN snapshot_members, DAOHaus_members, d.forum as forum, d.discord as discord, d.documentation as documentation, d.twitter as twitter, d.opensea as OpenSea, d.blog as blog

This query assumes some properties that are not currently present in the type definitions for Entities. Here's the properties of Entity (as is currently in develop)

type Entity {
"""
TODO: Should this be restricted
"""
uuid: ID @id(autogenerate: true)
name: String @unique #under assumption name for entities are unique
id: String @unique
minScore: Float
network: Float
onlyMembers: String
symbol: String
address: String @unique
avatar: String
about: String
proposals: [Proposal] @relationship(type: "HAS_PROPOSAL", direction: OUT)
}

I know @musubipapi is expanding these by creating unions of different Entity types (is there a Pull Request open for this change?); for example, Entity:Snapshot properties will be different than Entity:DAOhaus properties.

@Azharo For the properties you list here above: opensea, documentation, etc - how do you envision these aligning to specific Entity types as laid out in the GraphQL API type definitions?

from chainverse-frontend.

Azharo avatar Azharo commented on August 12, 2024

These properties will eventually just get taken out as separate nodes attached to each :Entity which hasn't been done yet. That'll remove any problems with the union since right now the Union is only really going to have name property.
This way we can connect different Entities as the same entity if they reference the same descriptor such as they have the same twitter handle or medium.
I'll add to issue that we need to expand these out as nodes and not keep as properties

Change current code snippet above to the following so it works even with our GraphQL types so at least we have it working in the UX while we make the right changes on the backend:

MATCH (d:Entity {name:$name})
OPTIONAL MATCH (d)-[:HAS_PROPOSAL]->(:Proposal)<-[:VOTED]-(sm:Wallet)
WITH d, COUNT(DISTINCT sm) as snapshot_members
OPTIONAL MATCH (d)<-[:IS_MEMBER]-(dm:Member)
WITH d, snapshot_members, COUNT(DISTINCT dm) as DAOHaus_members
OPTIONAL MATCH (dao:DaoHaus:Dao {name:$name})
RETURN snapshot_members, DAOHaus_members, dao.forum as forum, dao.discord as discord, dao.documentation as documentation, dao.twitter as twitter, dao.opensea as OpenSea, dao.blog as blog

from chainverse-frontend.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.