-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphqls
207 lines (197 loc) · 3.84 KB
/
schema.graphqls
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#scalar Date
type Query {
profileByUserId(id: ID!): User
friendsByStatus(status: UserStatus): [User]!
allFriends: [User]!
#scores: [Score]
#settingsByUserId(id: Int!): UserSettings
getLobbies: [Lobby]
concludeGame: GameStats
}
type Mutation {
register(input: RegisterInput!): User
login(input: LoginInput!): User
logout: Boolean!
reset(input: ResetInput!): User
resetWithToken(input: ResetTokenInput!): User
#updateUserProfile(input: UserSettingsInput!): User
addFriend(friendId: ID!): [User]
tutorialFinished: Boolean!
createLobby(input: LobbyInput!): Lobby
joinLobbyById(id: ID!): Lobby
#deleteLobby(id: ID!): Boolean
updateLobbySettings(input: GameSettingsInput!): Lobby
#sendLobbyMessage(message: String!): String
inviteToLobby(input: LobbyInviteInput!): Boolean
#requestFriendByUserId(id: ID!): ID
#sendMessageToUserId(input: MessageInput!): Message
announceStandby: Boolean
submitGuess(word: String!): GameRound
playAgain: Boolean
}
type Subscription {
lobbyList: [Lobby]
lobby(id: ID!): Lobby
lobbyInvites: LobbyInvite
friendsUpdates: User!
#lobbyChat: Message
#friendStatus: User # I suggest we use player (and thus add status to the player..)
#friendRequest: ID # ID instead of User
#chatMessages: Message
#lobbyReady: ID # I suggest we use the Lobby ID?
gameStatus(id: ID!): GameStatus
opponentGameRound: [GameRound]
}
#--------------------------------------------------
input RegisterInput {
username: String!
email: String!
password: String!
}
input LoginInput {
username: String!
password: String!
}
input ResetInput {
email: String!
}
input ResetTokenInput {
resetToken: String!
password: String!
}
input LobbyInviteInput {
recipientId: ID
lobbyId: ID!
}
#input UserSettingsInput {
# avatarID: String!
# volume: Int!
# status: UserStatus!
# # ...
#}
input LobbyInput {
size: Int!
name: String!
gameCategory: GameCategory!
}
input GameSettingsInput {
gameMode: GameMode!
amountRounds: Int
roundTime: Int
categories: [String]
}
#input MessageInput {
# userId: ID!
# message: String!
#}
#--------------------------------------------------
type User {
id: ID
username: String
email: String
status: UserStatus
}
type Player {
id: ID
name: String
avatarId: String
lobbyId: String
}
type UserSettings {
avatarID: String!
volume: Int!
status: UserStatus!
# ...
}
type Score {
mode: GameMode!
score: Int!
}
type Lobby {
id: ID!
name: String!
size: Int!
owner: Player!
status: LobbyStatus!
gameCategory: GameCategory!
gameMode: GameMode!
categories: [String]
game: Game!
players: [Player]
}
type LobbyInvite {
id: ID
lobbyId: ID!
senderId: ID
recipientId: ID
}
type Game {
amountRounds: Int
roundTime: Int
maxRounds: Int
maxTime: Int
# wordCategories: Categories ??? how
}
type GameRound {
player: Player
currentRound: Int
#targetWord: String
finished: Boolean
words: [String]
letterStates: [[LetterState]]
}
type GameStats {
targetWord: String
roundsTaken: Int
timeTaken: String
score: Int
ranking: [Player]
}
type Message {
userId: ID
message: String
}
#--------------------------------------------------
enum UserStatus {
ONLINE
CREATING_LOBBY
INGAME
AWAY
OFFLINE
}
enum GameCategory {
PVP
COOP
SOLO
}
enum GameMode {
WORDSPP
SONICFAST
TIMERESET
PARTY
CHALLENGE
CHAIN
CLASSIC
INTIME
PLAYERVSAI
ONEWORD
WORDCOMBINATION
}
enum LobbyStatus {
OPEN
FULL
INGAME
}
enum GameStatus {
NEW
SYNCING
GUESSING
WAITING
FINISHED
}
enum LetterState {
UNKNOWN
CORRECTPOSITION
INWORD
WRONG
}