-
Notifications
You must be signed in to change notification settings - Fork 4
/
schema.graphql
102 lines (85 loc) · 1.67 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Types
directive @hasAuth on FIELD_DEFINITION
scalar Timestamp
enum GameType {
STANDARD
}
enum GameState {
NEGOTIATION
IN_PROGRESS
FINISHED
}
enum GameUserEdgeType {
OWNER
PLAYER
}
enum Event {
CREATE
UPDATE
DELETE
}
interface Node {
id: ID!
createdAt: Timestamp!
updatedAt: Timestamp
}
type Identity implements Node {
id: ID!
email: String!
user: User!
createdAt: Timestamp!
updatedAt: Timestamp
}
type User implements Node {
id: ID!
name: String!
createdAt: Timestamp!
updatedAt: Timestamp
}
type Game implements Node {
id: ID!
type: GameType!
state: GameState!
boardSize: Int!
createdAt: Timestamp!
updatedAt: Timestamp
users: [GameUserEdge!]
}
type MatchmakingRequest implements Node {
id: ID!
queue: String!
user: User
rank: Int!
delta: Int!
createdAt: Timestamp!
updatedAt: Timestamp
}
# Relationships
type GameUserEdge {
index: Int!
user: User!
type: GameUserEdgeType!
}
input CreateMatchmakingRequestInput {
delta: Int!
}
type CreateMatchmakingRequestPayload {
request: MatchmakingRequest
}
type MatchmakingRequestCompletionPayload {
game: Game!
}
type Query {
game(id: ID): Game
games(ids: [ID!], states: [GameState!]): [Game]
user(id: ID, name: String): User
users(ids: [ID!], names: [String!]): [User]
viewer: Identity @hasAuth
matchmakingRequests: [MatchmakingRequest!]
}
type Mutation {
createMatchmakingRequest(input: CreateMatchmakingRequestInput!): CreateMatchmakingRequestPayload! @hasAuth
}
type Subscription {
matchmakingRequestCompletions: MatchmakingRequestCompletionPayload
}