-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlean-coffee.schema
77 lines (70 loc) · 1.95 KB
/
lean-coffee.schema
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
type File implements Node {
contentType: String!
createdAt: DateTime!
id: ID! @isUnique
name: String!
secret: String! @isUnique
size: Int!
updatedAt: DateTime!
url: String! @isUnique
}
type LeanCoffee implements Node {
createdAt: DateTime!
host: Participant @relation(name: "LeanCoffeeOnParticipant")
id: ID! @isUnique
state: LeanCoffeeState!
topics: [Topic!]! @relation(name: "LeanCoffeeOnTopic")
updatedAt: DateTime!
user: User @relation(name: "UserOnLeanCoffee")
votes: [Vote!]! @relation(name: "VoteOnLeanCoffee")
votesPerUser: Int @defaultValue(value: 5)
}
enum LeanCoffeeState {
TOPIC_COLLECTION
TOPIC_VOTING
DISCUSSION
}
type Participant implements Node {
createdAt: DateTime!
id: ID! @isUnique
leanCoffee: LeanCoffee @relation(name: "LeanCoffeeOnParticipant")
name: String!
topics: [Topic!]! @relation(name: "ParticipantOnTopic")
updatedAt: DateTime!
votes: [Vote!]! @relation(name: "VoteOnParticipant")
}
type Topic implements Node {
createdAt: DateTime!
id: ID! @isUnique
leanCoffee: LeanCoffee @relation(name: "LeanCoffeeOnTopic")
name: String!
participant: Participant @relation(name: "ParticipantOnTopic")
state: TopicState!
updatedAt: DateTime!
user: User @relation(name: "UserOnTopic")
votes: [Vote!]! @relation(name: "VoteOnTopic")
}
enum TopicState {
CURRENT
OPEN
CLOSED
}
type User implements Node {
auth0UserId: String @isUnique
createdAt: DateTime!
id: ID! @isUnique
leanCoffees: [LeanCoffee!]! @relation(name: "UserOnLeanCoffee")
name: String!
topics: [Topic!]! @relation(name: "UserOnTopic")
updatedAt: DateTime!
votes: [Vote!]! @relation(name: "UserOnVote")
}
type Vote implements Node {
createdAt: DateTime!
id: ID! @isUnique
leanCoffee: LeanCoffee @relation(name: "VoteOnLeanCoffee")
participant: Participant @relation(name: "VoteOnParticipant")
topic: Topic @relation(name: "VoteOnTopic")
updatedAt: DateTime!
user: User @relation(name: "UserOnVote")
}