-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
60 lines (53 loc) · 1.19 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
enum EventStatus{
Active
Ended
}
type EventCreator @entity(immutable: true){
id: ID!
createdEvents: [FundingEvent!] @derivedFrom(field: "owner")
}
type User @entity{
id: ID!
participatedEvents: [UserFundingEvent!] @derivedFrom(field: "user")
projects: [Project!] @derivedFrom(field: "owner")
votesLeft: BigInt!
completedVotes: [Vote!] @derivedFrom(field: "user")
earnings: BigInt!
}
type FundingEvent @entity{
id: ID!
eventCID: String!
eventDetails: IpfsMetadataDetails
owner: EventCreator!
status: EventStatus
prizePool: BigInt!
users: [UserFundingEvent!] @derivedFrom(field: "event")
projects: [Project!] @derivedFrom(field: "event")
}
type UserFundingEvent @entity(immutable: true){
id: ID!
user: User!
event: FundingEvent!
}
type Project @entity{
id: ID!
owner: User!
event: FundingEvent!
projectCID: String!
projectDetails: IpfsMetadataDetails
amountWon: BigInt!
amountWithdrawn: Boolean!
votes: [Vote!] @derivedFrom(field: "project")
}
type Vote @entity(immutable: true){
id: ID!
project: Project!
user: User!
voteCount: BigInt!
}
type IpfsMetadataDetails @entity {
id: ID!
name: String!
description: String!
link: String!
}