-
Notifications
You must be signed in to change notification settings - Fork 69
/
typeDefs.ts
204 lines (189 loc) · 3.97 KB
/
typeDefs.ts
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
import { gql } from '@apollo/client'
export default gql`
type Query {
lessons: [Lesson!]!
session: Session!
allUsers: [User]
getLessonMentors(lessonId: Int!): [User]
userInfo(username: String!): Session
isTokenValid(cliToken: String!): Boolean!
submissions(lessonId: Int!): [Submission!]
alerts: [Alert!]!
getPreviousSubmissions(challengeId: Int!, userId: Int!): [Submission!]
}
type TokenResponse {
success: Boolean
token: String
}
type Mutation {
setStar(mentorId: Int!, lessonId: Int!, comment: String): SuccessResponse!
login(username: String!, password: String!): AuthResponse
logout: AuthResponse
reqPwReset(userOrEmail: String!): SuccessResponse!
changePw(token: String!, password: String!): AuthResponse
changeAdminRights(id: Int!, status: Boolean!): SuccessResponse
signup(
firstName: String!
lastName: String!
email: String!
username: String!
password: String
): AuthResponse
addAlert(
text: String!
type: String!
url: String
urlCaption: String
): [Alert]
removeAlert(id: Int!): SuccessResponse
createSubmission(
lessonId: Int!
challengeId: Int!
cliToken: String!
diff: String!
): Submission
acceptSubmission(id: Int!, comment: String!, lessonId: Int!): Submission
rejectSubmission(id: Int!, comment: String!, lessonId: Int!): Submission
addComment(
line: Int
fileName: String
submissionId: Int!
content: String!
): Comment
createLesson(
description: String!
docUrl: String
githubUrl: String
videoUrl: String
title: String!
chatUrl: String
order: Int!
): [Lesson]
updateLesson(
id: Int!
description: String!
docUrl: String
githubUrl: String
videoUrl: String
title: String!
chatUrl: String
order: Int!
): [Lesson]
createChallenge(
lessonId: Int!
order: Int!
description: String!
title: String!
): [Lesson]
updateChallenge(
lessonId: Int!
order: Int!
description: String!
title: String!
id: Int!
): [Lesson]
}
type AuthResponse {
success: Boolean
username: String
error: String
cliToken: String
}
type SuccessResponse {
success: Boolean
}
type Submission {
id: Int!
status: SubmissionStatus!
mrUrl: String
diff: String
viewCount: Int
comment: String
userId: String
order: Int
lessonId: Int!
challengeId: Int!
challenge: Challenge!
reviewer: User
user: User!
reviewerId: String
createdAt: String
updatedAt: String!
comments: [Comment!]
}
type Comment {
id: Int!
fileName: String
line: Int
content: String!
authorId: Int!
submissionId: Int!
createdAt: String!
author: User
submission: Submission
}
enum SubmissionStatus {
overwritten
needMoreWork
open
passed
}
type User {
id: Int!
username: String!
userLesson: UserLesson
email: String!
name: String!
isAdmin: Boolean!
cliToken: String
}
type Session {
user: User
submissions: [Submission!]
lessonStatus: [UserLesson!]!
}
type UserLesson {
id: Int!
userId: String
lessonId: Int!
isPassed: String
isTeaching: String
isEnrolled: String
starsReceived: [Star]
starGiven: String
}
type Lesson {
id: Int!
description: String!
docUrl: String
githubUrl: String
videoUrl: String
order: Int!
title: String!
challenges: [Challenge]
users: [User]
currentUser: User
chatUrl: String
}
type Challenge {
id: Int!
description: String!
lessonId: Int!
title: String!
order: Int!
}
type Alert {
id: Int!
text: String
type: String
url: String
urlCaption: String
}
type Star {
id: Int!
lessonId: Int!
comment: String
student: User!
lesson: Lesson!
}
`