forked from fossabot/HomeKeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.graphql
More file actions
312 lines (253 loc) · 7.14 KB
/
schema.graphql
File metadata and controls
312 lines (253 loc) · 7.14 KB
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
type Query {
"""Lists Tasks in the given team."""
tasks(teamId: Int!, onlyActive: Boolean = false): [TaskType]
"""Lists TaskIntances in the given team."""
taskInstances(teamId: Int!, onlyActive: Boolean = false): [TaskInstanceType]
"""Lists TaskIntances of the given task."""
relatedTaskInstances(taskId: Int!, onlyActive: Boolean = false): [TaskInstanceType]
"""Lists history of TaskInsance completions in the given team."""
completions(teamId: Int!, onlyActive: Boolean = false): [TaskInstanceCompletionType]
"""
Counts points for a given user in a given team.
User has to be a member of the given team.
Logged in user has to be member of the given team.
"""
userPoints(userId: Int!, teamId: Int!, fromDatetime: DateTime = null, toDatetime: DateTime = null): Int
"""
Counts points for each member of a given team.
Logged in user has to be member of the given team.
"""
teamMembersPoints(teamId: Int!, fromDatetime: DateTime = null, toDatetime: DateTime = null): [MemberPointsType]
me: UserType
myTeams: [TeamType]
teams: [TeamType]
teamMembers(teamId: Int = null): [UserType]
}
type TaskType {
id: ID!
name: String!
description: String!
team: TeamType
basePointsPrize: Int!
refreshInterval: String
isRecurring: Boolean!
active: Boolean
}
type TeamType {
id: ID!
createdAt: DateTime!
createdBy: UserType
modifiedAt: DateTime!
deletedAt: DateTime
name: String!
members: [UserType!]!
taskSet: [TaskType!]!
}
"""
The `DateTime` scalar type represents a DateTime
value as specified by
[iso8601](https://en.wikipedia.org/wiki/ISO_8601).
"""
scalar DateTime
type UserType {
id: ID!
password: String!
lastLogin: DateTime
"""
Designates that this user has all permissions without explicitly assigning them.
"""
isSuperuser: Boolean!
"""Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."""
username: String!
firstName: String!
lastName: String!
email: String!
"""Designates whether the user can log into this admin site."""
isStaff: Boolean!
"""
Designates whether this user should be treated as active. Unselect this instead of deleting accounts.
"""
isActive: Boolean!
dateJoined: DateTime!
profile: ProfileType
teamSet: [TeamType!]!
taskinstancecompletionSet: [TaskInstanceCompletionType!]!
}
type ProfileType {
id: ID!
imageId: String
colorId: String
user: UserType!
}
type TaskInstanceCompletionType {
id: ID!
createdAt: DateTime!
deletedAt: DateTime
taskInstance: TaskInstanceType!
userWhoCompletedTask: UserType!
pointsGranted: Int!
active: Boolean
}
type TaskInstanceType {
id: ID!
deletedAt: DateTime
task: TaskType!
activeFrom: DateTime!
completed: Boolean!
active: Boolean
currentPrize: Int
}
type MemberPointsType {
member: UserType
points: Int
}
type Mutation {
createTask(input: TaskCreateGenericType!): TaskSerializerMutation
updateTask(input: TaskUpdateGenericType!): TaskSerializerMutation
deleteTask(
"""Django object unique identification field"""
id: ID!
): TaskSerializerMutation
submitTaskInstanceCompletion(input: TaskInstanceCompletionCreateGenericType!): TaskInstanceCompletionSerializerMutation
revertTaskInstanceCompletion(
"""Django object unique identification field"""
id: ID!
): TaskInstanceCompletionSerializerMutation
register(input: RegisterInput!): RegisterPayload
setProfileData(input: ProfileInput!): SetProfileData
createTeam(input: CreateTeamInput!): CreateTeamPayload
joinTeam(password: String = null, teamId: Int = null): JoinTeam
leaveTeam(teamId: Int = null): LeaveTeam
"""Obtain JSON Web Token mutation"""
tokenAuth(username: String!, password: String!): ObtainJSONWebToken
verifyToken(token: String = null): Verify
refreshToken(token: String = null): Refresh
}
"""DRF serializer based Mutation for Tasks."""
type TaskSerializerMutation {
task: TaskType
"""Boolean field that return mutation result request."""
ok: Boolean
"""Errors list for the field"""
errors: [ErrorType]
}
type ErrorType {
field: String!
messages: [String!]!
}
"""Auto generated InputType for Task model"""
input TaskCreateGenericType {
"""base points prize"""
basePointsPrize: Int!
"""name"""
name: String!
"""team"""
team: ID!
"""description"""
description: String
""""""
isRecurring: Boolean
"""refresh interval"""
refreshInterval: Float
}
"""Auto generated InputType for Task model"""
input TaskUpdateGenericType {
"""Django object unique identification field"""
id: ID!
"""name"""
name: String
"""description"""
description: String
"""team"""
team: ID = null
"""base points prize"""
basePointsPrize: Int
"""refresh interval"""
refreshInterval: Float
""""""
isRecurring: Boolean
}
"""DRF serializer based Mutation for TaskInstanceCompletions."""
type TaskInstanceCompletionSerializerMutation {
taskInstanceCompletion: TaskInstanceCompletionType
"""Boolean field that return mutation result request."""
ok: Boolean
"""Errors list for the field"""
errors: [ErrorType]
}
"""Auto generated InputType for TaskInstanceCompletion model"""
input TaskInstanceCompletionCreateGenericType {
"""task instance"""
taskInstance: ID!
}
type RegisterPayload {
"""Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."""
username: String!
"""
<ul><li>Your password can’t be too similar to your other personal information.</li><li>Your password must contain at least 8 characters.</li><li>Your password can’t be a commonly used password.</li><li>Your password can’t be entirely numeric.</li></ul>
"""
password1: String!
"""Enter the same password as before, for verification."""
password2: String!
email: String
errors: [ErrorType]
clientMutationId: String
}
input RegisterInput {
"""Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only."""
username: String!
"""
<ul><li>Your password can’t be too similar to your other personal information.</li><li>Your password must contain at least 8 characters.</li><li>Your password can’t be a commonly used password.</li><li>Your password can’t be entirely numeric.</li></ul>
"""
password1: String!
"""Enter the same password as before, for verification."""
password2: String!
email: String
clientMutationId: String
}
type SetProfileData {
profile: ProfileType
}
input ProfileInput {
userId: ID
imageId: String
colorId: String
}
type CreateTeamPayload {
team: TeamType
errors: [ErrorType]
clientMutationId: String
}
input CreateTeamInput {
name: String!
"""Password used to join the team"""
password: String!
id: ID
clientMutationId: String
}
type JoinTeam {
team: TeamType
}
type LeaveTeam {
team: TeamType
}
"""Obtain JSON Web Token mutation"""
type ObtainJSONWebToken {
payload: GenericScalar!
refreshExpiresIn: Int!
token: String!
}
"""
The `GenericScalar` scalar type represents a generic
GraphQL scalar value that could be:
String, Boolean, Int, Float, List or Object.
"""
scalar GenericScalar
type Verify {
payload: GenericScalar!
}
type Refresh {
payload: GenericScalar!
refreshExpiresIn: Int!
token: String!
}