-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
57 lines (52 loc) · 1.32 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
type Publication @entity {
id: ID! # `${publicationId.toHexString}`
hash: String!
author: String!
topic: Topic!
publishDate: BigInt!
voting: Voting!
}
type Voting @entity {
id: ID! # `${publicationId.toHexString}`
publication: Publication!
topic: Topic!
withdrawn: Boolean!
voteCounters: [BigInt!]!
winningVote: Int!
jurors: [Juror!]!
votes: [Vote!]! @derivedFrom(field: "voting")
}
type Vote @entity {
id: ID! # `${jurorAddress}@${publicationId.toHexString}`
voting: Voting!
juror: Juror!
commitment: String
value: Int!
justification: String
penalized: Boolean!
withdrawn: Boolean!
}
type Topic @entity {
id: ID! # `${topicId}`
priceToPublish: BigInt!
priceToBeJuror: BigInt!
authorReward: BigInt!
jurorReward: BigInt!
commitPhaseDuration: BigInt!
revealPhaseDuration: BigInt!
selectableJurorsQuantity: BigInt!
subscriptions: [JurorSubscription!]! @derivedFrom(field: "topic")
publications: [Publication!]! @derivedFrom(field: "topic")
votings: [Voting!]! @derivedFrom(field: "topic")
}
type Juror @entity {
id: ID! # `${jurorAddress}`
subscriptions: [JurorSubscription!]! @derivedFrom(field: "juror")
votes: [Vote!]! @derivedFrom(field: "juror")
}
type JurorSubscription @entity {
id: ID! # `${jurorAddress}@${topicId}`
juror: Juror!
topic: Topic!
times: BigInt!
}