Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deciding on schema for Everest subgraph #1

Closed
davekaj opened this issue Dec 5, 2019 · 1 comment
Closed

Deciding on schema for Everest subgraph #1

davekaj opened this issue Dec 5, 2019 · 1 comment
Assignees

Comments

@davekaj
Copy link
Contributor

davekaj commented Dec 5, 2019

Below is the proposed schema. @nenadjaja needs this to work on the front end with mock data. It will need input from @yanivtal

type Project {
    id: ID!
    # From IPFS / off chain storage
    name: String!
    description: String!
    website: String
    twitter: String
    github: String # Make sure we call it github or something else
    avatar: String
    image: String
    ipfsHash: String!
    categories: [Category!]! 

    # From smart contracts directly
    owner: User
    isChallenged: Bool
    challenges: [Challenge]
    isWhitelistedProject: Bool! # check with Brandon
    createdAt: Int! # This would allow you to know when it will become a full member too
    delegateAddress: Bytes # Null if no delegate is set
    isRepresentative: Bool

    # Derived from smart contract events
    totalVotes: Int!
    reputation: Int!

    # All votes a Project has made
    votes: [Vote] @derivedFrom(field: "projectID")
}

type Category {
   id: ID!
   name: String!
   description: String!
   slug: String!
   projects: [Project]
   subcategories: [Category] @derivedFrom(field: "ID")
}

type Challenge {
    id: ID!
    description: String
    createdAt: Int!
    votesFor: Int!
    votesAgainst: Int!
    project: Project!
    owner: Bytes!
    resolved: Bool! #  means it's a past challenge
    votes: [Vote] @derivedFrom(field: "challengeID")
}

# For global variables
type Everest {
    id: ID!
    period: Int! # how long the challenge will last
    votingPeriodDuration: Int!
    whitelistPeriodDuration: Int!
    challengeDeposit: BigInt!
    applicationFee: BigInt!
    approvedToken: Bytes!
    reserveBank: Bytes!
    registry: Bytes!
}

type Vote {
    id: ID! # concatenation of challenge ID and voter address
    challenge: Challenge!
    choice: Choice!
}

enum Choice {
    RemoveProject
    KeepProject
}

    # Decide what we want to show from 3box (example: https://3box.io/0xbeb1faa6e7e39c7d9bdab03a7a362fe9d73d7c61/details)
type User {
     id: ID!
     name: String
     bio: String
     projects: [Project]
     challenges: [Challenge] # challenges you started
     votes: [Project] # participation in other people's challenges
}
@davekaj
Copy link
Contributor Author

davekaj commented Mar 3, 2020

We are far past this

@davekaj davekaj closed this as completed Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants