forked from developerfred/envio-indexer-template-gov
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
87 lines (79 loc) · 1.9 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
type Organization @entity {
id: ID!
token: String!
delegates: [DelegateOrganization!] @derivedFrom(field: "organization")
delegators: [DelegatorOrganization!] @derivedFrom(field: "organization")
roposals: [Proposal!] @derivedFrom(field: "organization")
votes: [Vote!] @derivedFrom(field: "organization")
}
type User @entity {
id: ID!
votes: [Vote!]! @derivedFrom(field: "user")
organizations: [Organization!]
delegateOrganizations: [DelegateOrganization!] @derivedFrom(field: "delegate")
delegatorOrganizations: [DelegatorOrganization!]
@derivedFrom(field: "delegator")
}
type Proposal @entity {
id: ID!
status: String!
description: String!
proposer: String!
votes: [Vote!]! @derivedFrom(field: "proposal")
organization: Organization!
timestamp: BigInt!
startDate: BigInt!
endDate: BigInt
}
type Vote @entity {
id: ID!
user: User!
proposal: Proposal!
support: Int
solution: BigInt
weight: BigInt
reason: String
organization: Organization!
timestamp: BigInt!
}
type DelegateOrganization @entity {
id: ID! # Set to `${user.id}-${organization.id}`
delegate: User!
organization: Organization!
voteBalance: BigInt!
firstTokenDelegatedAt: BigInt
}
type DelegatorOrganization @entity {
id: ID! # Set to `${user.id}-${organization.id}`
delegator: User!
delegate: User!
organization: Organization!
}
type DelegateVotingPowerChange @entity {
id: ID!
tokenAddress: String!
delegate: String!
previousBalance: BigInt!
newBalance: BigInt!
blockTimestamp: BigInt
txnHash: String!
blockNumber: BigInt!
}
type DelegateChange @entity {
id: ID!
oldDelegate: String
newDelegate: String
delegator: String!
blockTimestamp: BigInt!
txnHash: String!
blockNumber: BigInt!
}
type DelegatingHistory @entity {
id: String!
daoName: String!
fromDelegate: String
toDelegate: String
delegator: String!
amount: BigInt!
timestamp: BigInt!
}