-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
379 lines (334 loc) · 6.53 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
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
"""
The DateTime scalar type represents textual data, represented as ISO-8601 format.
"""
scalar DateTime
type Query {
"""
Details about the application.
"""
appInfo: AppInfo!
"""
Details about self.
"""
self: Self!
challenger(id: ID!): Challenger
challengers(page: Int!, offset: Int!): [Challenger!]!
problem(id: ID!): Problem
problems(
page: Int = 0
offset: Int = 20
option: ProblemOptionInput
): Problems
ranking(challengerId: ID!, rankingOption: RankingOptionInput): Ranking
rankings(
page: Int = 0
offset: Int = 20
rankingOption: RankingOptionInput
): Rankings
}
type Mutation {
refreshToken(authToken: String!): String
modifyNameOfSelf(name: String!): Boolean
modifyProfileTextOfSelf(text: String!): Boolean
addAnswerToProblem(problemId: ID!, answer: ChallengerAnswer!): Answer!
changeLanguage(languageId: String!): Boolean
}
input ProblemOptionInput {
kind: ID
sortBy: ID
filterBy: ID
}
input RankingOptionInput {
kind: ID
sortBy: ID
filterBy: ID
}
input ChallengerAnswer {
language: ID!
source: String!
}
interface Node {
id: ID!
createdAt: DateTime!
}
interface PageInfo {
hasPrevious: Boolean!
hasNext: Boolean!
}
interface User {
id: ID!
name: String!
role: Role!
createdAt: DateTime!
}
interface Identifiable {
name: String!
url: String!
}
interface Option {
id: String!
name: String!
description: String!
}
"""
Application information that the client can pre-cache to improve performance.
"""
type AppInfo {
"""
The name of the application.
"""
name: String!
"""
A description of the application.
"""
description: String
"""
A catchphrase of the application.
"""
catchPhrase: String
"""
Current OJIC supported version of the application.
"""
version: String!
"""
Current OJIC supported level of the application.
"""
level: Int!
"""
Languages that supports the judging of the source code of the answers in the application.
"""
languages(id: ID! = null): [Language!]!
"""
Programming languages that supports the judging of the source code of the answers in the application.
"""
programmingLanguages: [ProgrammingLanguage!]!
"""
A collection of roles for the application.
"""
roles: [Role!]!
"""
"""
rankingOptions: [RankingOption!]!
}
"""
The language people-to-people use to communicate, such as Korean, English, and Japanese.
"""
type Language implements Node {
"""
The identifier, represented as ISO-639-1 format.
"""
id: ID!
"""
The string, represented as ISO language name.
"""
name: String!
"""
The time when the application started supporting the language.
"""
createdAt: DateTime!
}
"""
A programming language that can be used to solve problems.
"""
type ProgrammingLanguage implements Node {
"""
An identifier used to identify the language.
"""
id: ID!
"""
A name that refers to the programming language, such a C++.
"""
name: String!
"""
A more detailed name for the programming language, such a C++17.
"""
detailName: String!
"""
The runtime of the programming language used by the application to judge the source code of the answers, such a gcc (x86_64-posix-seh, Built by strawberryperl.com project) 7.1.0.
"""
runtime: String!
"""
Commands used to judge answer source code.
"""
commands: Commands!
"""
The time from the answer source code execution to the forced termination.
"""
maxTime: Int!
"""
Total memory available after source code execution.
"""
maxMemory: Int!
"""
libraries that can be used when solving problems in this language.
"""
libraries: [Library]!
"""
The time when the application started supporting the language.
"""
createdAt: DateTime!
}
"""
The commands used to compile or execute the source code.
"""
type Commands {
"""
command in compile time.
"""
compile: String
"""
command in execution time.
"""
execute: String!
}
"""
Additional libraries available in the programming language environment.
"""
type Library {
name: String!
version: String!
}
"""
Role such as administrator, organizer.
"""
type Role implements Option {
id: String!
name: String!
description: String!
}
type RankingOption {
id: String!
name: String!
description: String!
sortBy: [SortBy!]!
filterBy: [FilterBy!]!
}
type SortBy implements Option {
id: String!
name: String!
description: String!
}
type FilterBy implements Option {
id: String!
name: String!
description: String!
}
"""
"""
type Self implements User {
id: ID!
name: String!
role: Role!
createdAt: DateTime!
}
"""
a user who can submit an answer to a problem.
"""
type Challenger implements User {
id: ID!
name: String!
role: Role!
createdAt: DateTime!
}
type Problem implements Node {
id: ID!
title: String
wirter: ProblemWriter
creator: [ProblemCreator!]!
translator: [ProblemTranslator!]!
contributor: [ProblemContributor!]!
tags: [String!]!
programmingLanguages: [ProgrammingLanguage!]!
explains(languages: [ID!] = null): [Explain!]!
samples: [Sample!]!
createdAt: DateTime!
}
type ProblemWriter implements User {
id: ID!
name: String!
role: Role!
createdAt: DateTime!
}
type ProblemCreator implements Identifiable {
name: String!
url: String!
}
type ProblemTranslator implements Identifiable {
name: String!
url: String!
}
type ProblemContributor implements Identifiable {
name: String!
url: String!
}
type Problems {
pageInfo: ProblemPageInfo!
problems: [Problem!]!
}
type ProblemPageInfo implements PageInfo {
hasPrevious: Boolean!
hasNext: Boolean!
}
type Explain {
"""
ISO 639-1
"""
languages: [Language!]!
mimeType: String
text: String
}
"""
I/O that guarantee the same input/output when scored as a correct answer to a particular problem.
"""
type Sample {
input: String!
output: String!
}
type Answer {
source: String!
"""
ISO 639-1
"""
language: String!
state: AnswerState!
info: AnswerInfo
}
enum AnswerState {
Submitted
Initialized
Judging
Completed
}
type AnswerInfo {
result: ResultResult!
usedMemories: Int!
usedTimes: Int!
}
enum ResultResult {
CorrectAnswer
WrongAnswer
CompilationError
RuntimeError
TimeLimitExceeded
FormatError
}
type Statistics {
problemCount: Int!
answersCount: Int!
}
type Ranking {
challenger: Challenger!
}
type Rankings {
pageInfo: RankingPageInfo!
challengers: [Challenger!]!
}
type RankingPageInfo implements PageInfo {
hasPrevious: Boolean!
hasNext: Boolean!
}
type RankingKind implements Option {
id: String!
name: String!
description: String!
}