GraphQL API
Govern Server is exposing a GraphQL API that lets you fetch data related to your Govern DAOs. Here is the complete list of queries and types that are available.

Queries

dao(name: String!): Dao

Use this query to get a single DAO, using its name. See the Dao type to know more information.

daos: [Dao]

Use this query to get the list of DAOs.

Types

GovernRegistry

Represents the DAO registry. It contains entries, which have a name and contain a queue and an executor. A DAO is identified by its name.
1
type GovernRegistry {
2
id: ID!
3
address: String!
4
count: Int!
5
entries: [RegistryEntry!]!
6
}
Copied!

RegistryEntry

A single registry entry. It has a name, a queue and an executor. A DAO is identified by its name.
1
type RegistryEntry {
2
id: ID!
3
name: String!
4
queue: GovernQueue!
5
executor: Dao!
6
}
Copied!

Dao

A single DAO entry.
1
type Dao {
2
id: ID!
3
address: String!
4
metadata: String
5
registryEntries: [RegistryEntry!]!
6
containers: [Container]!
7
roles: [Role!]!
8
queues: [GovernQueue]!
9
}
Copied!

GovernQueue

Represents an queue of scheduled actions (Container) and a configuration.
1
type GovernQueue {
2
id: ID!
3
address: String!
4
config: Config!
5
registryEntries: [RegistryEntry!]!
6
queued: [Container!]!
7
roles: [Role!]!
8
}
Copied!

Config

The configuration of a GovernQueue.
1
type Config {
2
id: ID!
3
queue: GovernQueue!
4
executionDelay: String!
5
scheduleDeposit: Collateral!
6
challengeDeposit: Collateral!
7
resolver: String!
8
rules: String!
9
}
Copied!

Container

A Container represents an action being scheduled for execution, inside a GovernQueue. It also contains the configuration at the time it was scheduled, and a history of past events.
1
type Container {
2
id: ID!
3
queue: GovernQueue!
4
state: ContainerState!
5
config: Config!
6
payload: ContainerPayload!
7
history: [ContainerEvent!]!
8
}
Copied!

ContainerState

The different states of a Container.
1
enum ContainerState {
2
None
3
Scheduled
4
Approved
5
Challenged
6
Rejected
7
Cancelled
8
Executed
9
}
Copied!

ContainerPayload

A list of actual actions attached to a Container.
1
type ContainerPayload {
2
id: ID!
3
container: Container!
4
nonce: String!
5
executionTime: String!
6
submitter: String!
7
executor: Dao!
8
actions: [Action!]!
9
allowFailuresMap: String!
10
proof: String!
11
}
Copied!

Action

Represents an independent action (transaction data) in a ContainerPayload.
1
type Action {
2
id: ID!
3
payload: ContainerPayload!
4
to: String!
5
value: String!
6
data: String!
7
}
Copied!

Collateral

Represents a collateral that gets attached to a Container when scheduling it and challenging it.
Scenario 1:
  • Bob submits an action to be executed, with a collateral attached to it.
  • The action passes and doesn’t get challenged.
  • The action gets executed and Bob receives its collateral back.
Scenario 2:
  • Bob submits an action to be executed, with a collateral attached to it.
  • The action passes but gets challenged by Alice, with a collateral attached.
  • The arbitrator approves the action. Bob Receives both collaterals.
Scenario 3:
  • Bob submits an action to be executed, with a collateral attached to it.
  • The action passes but gets challenged by Alice, with a collateral attached.
  • The arbitrator rejects the action. Alice Receives both collaterals.
1
type Collateral {
2
id: ID!
3
token: String!
4
amount: String!
5
}
Copied!

Role

The roles defined on a given GovernQueue.
1
type Role {
2
id: ID!
3
entity: String!
4
selector: String!
5
who: String!
6
granted: Boolean!
7
frozen: Boolean!
8
}
Copied!

ContainerEventChallenge

A Container event representing an action being challenged.
1
type ContainerEventChallenge {
2
id: ID!
3
container: Container!
4
createdAt: String!
5
actor: String!
6
collateral: Collateral!
7
disputeId: String!
8
reason: String!
9
resolver: String!
10
}
Copied!

ContainerEventExecute

A Container event representing an action being executed.
1
type ContainerEventExecute {
2
id: ID!
3
container: Container!
4
createdAt: String!
5
execResults: [String!]!
6
}
Copied!

ContainerEventResolve

A Container event representing an action being resolved.
1
type ContainerEventResolve {
2
id: ID!
3
container: Container!
4
createdAt: String!
5
approved: Boolean!
6
}
Copied!

ContainerEventRule

A Container event representing an action being ruled.
1
type ContainerEventRule {
2
id: ID!
3
container: Container!
4
createdAt: String!
5
ruling: String!
6
}
Copied!

ContainerEventSchedule

A Container event representing an action being scheduled.
1
type ContainerEventSchedule {
2
id: ID!
3
container: Container!
4
createdAt: String!
5
collateral: Collateral!
6
}
Copied!

ContainerEventSubmitEvidence

A Container event representing an evidence being submitted.
1
type ContainerEventSubmitEvidence {
2
id: ID!
3
container: Container!
4
createdAt: String!
5
evidence: String!
6
submitter: String!
7
finished: Boolean!
8
}
Copied!

ContainerEventVeto

A Container event representing an action being vetoed by the arbitrator.
1
type ContainerEventVeto {
2
id: ID!
3
container: Container!
4
createdAt: String!
5
reason: String!
6
}
Copied!
Last modified 1mo ago