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

GraphQL API #60

Merged
merged 24 commits into from
Oct 23, 2020
Merged

GraphQL API #60

merged 24 commits into from
Oct 23, 2020

Conversation

bpierre
Copy link
Contributor

@bpierre bpierre commented Oct 16, 2020

Available queries:

type Query {
  dao(address: String!): Dao!
  daos: [Dao!]!
  game(name: String!): OptimisticGame!
  games: [OptimisticGame!]!
}

Example to query a DAO and its queues:

dao {
  id
  queues {
    id
  }
}

Types:

type ERC3000Registry {
  id: ID!
  address: String!
  count: Int!
  games: [OptimisticGame!]
}

type OptimisticGame {
  id: ID!
  name: String!
  executor: Dao!
  queue: OptimisticQueue!
  metadata: String
}

type Dao {
  id: ID!
  address: String!
  games: [OptimisticGame!]
  executions: [Execution!]
  roles: [Role!]
  queues: [OptimisticQueue!]
}

type Execution {
  id: ID!
  sender: String!
  actions: [Action!]
  results: [String!]
}

type Action {
  id: ID!
  to: String!
  value: String!
  data: String!
  item: Item!
  execution: Execution
}

type OptimisticQueue {
  id: ID!
  address: String!
  config: Config
  games: [OptimisticGame!]
  queue: [Item!]
  executions: [Execution!]
  challenges: [Challenge!]
  vetos: [Veto!]
  roles: [Role!]
}

type Config {
  id: ID!
  queue: OptimisticQueue!
  executionDelay: String!
  scheduleDeposit: Collateral!
  challengeDeposit: Collateral!
  vetoDeposit: Collateral!
  resolver: String!
  rules: String!
}

type Collateral {
  id: ID!
  token: String!
  amount: String!
}

type Item {
  id: ID!
  status: ItemStatus!
  nonce: String!
  executionTime: String!
  submitter: String!
  executor: Dao!
  actions: [Action!]
  proof: String!
  collateral: Collateral!
  createdAt: String!
}

type Challenge {
  id: ID!
  queue: OptimisticQueue!
  challenger: String!
  item: Item!
  arbitrator: String!
  disputeId: String!
  evidences: [Evidence!]
  collateral: Collateral!
  ruling: String
  approved: Boolean
  createdAt: String!
}

type Evidence {
  id: ID!
  challenge: Challenge!
  data: String!
  submitter: String!
  createdAt: String!
}

type Veto {
  id: ID!
  queue: OptimisticQueue!
  item: Item!
  reason: String!
  submitter: String!
  collateral: Collateral!
  createdAt: String!
}

type Role {
  id: ID!
  entity: String!
  selector: String!
  who: String!
  granted: Boolean!
  frozen: Boolean!
}

enum ItemStatus {
  None
  Approved
  Cancelled
  Challenged
  Executed
  Rejected
  Scheduled
  Vetoed
}

@codecov-io
Copy link

codecov-io commented Oct 16, 2020

Codecov Report

Merging #60 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #60   +/-   ##
=======================================
  Coverage   22.58%   22.58%           
=======================================
  Files           3        3           
  Lines         124      124           
  Branches       14       14           
=======================================
  Hits           28       28           
  Misses         96       96           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76b620f...69e34eb. Read the comment docs.

@bpierre bpierre mentioned this pull request Oct 16, 2020
@bpierre bpierre added this to In progress in Aragon Govern v1.0 via automation Oct 16, 2020
@izqui izqui added this to the Beta X: Mainnet pre-release milestone Oct 19, 2020
Base automatically changed from thegraph-data to master October 19, 2020 10:25
@bpierre bpierre requested a review from 0xGabi October 19, 2020 19:42
@bpierre bpierre marked this pull request as ready for review October 19, 2020 19:51
Aragon Govern v1.0 automation moved this from In progress to Reviewer approved Oct 19, 2020
Copy link
Contributor

@0xGabi 0xGabi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me! I like the simple API you expose on the server.

packages/govern-server/package.json Outdated Show resolved Hide resolved
packages/govern-server/src/core/data/index.ts Outdated Show resolved Hide resolved
packages/govern-server/src/env.ts Show resolved Hide resolved
packages/govern-server/src/index.ts Show resolved Hide resolved
packages/govern-server/src/types.ts Show resolved Hide resolved
packages/govern-server/src/core/data/index.ts Outdated Show resolved Hide resolved
@bpierre bpierre merged commit e1e64c5 into master Oct 23, 2020
Aragon Govern v1.0 automation moved this from Reviewer approved to Done Oct 23, 2020
@bpierre bpierre deleted the graphql-api branch October 23, 2020 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants