-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.graphql
More file actions
89 lines (80 loc) · 1.53 KB
/
schema.graphql
File metadata and controls
89 lines (80 loc) · 1.53 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
type Query {
"""
The currently authenticated user.
"""
me: User
"""
Retrieve a task by its ID.
"""
task(id: ID!): Task
"""
Retrieve available tasks. Optionally perform a fulltext search using the `searchText` argument.
"""
filterTasks(searchText: String): [Task!]!
}
type Mutation {
login(email: String!, password: String!): User!
register(input: RegisterInput!): User!
createTask(input: CreateTaskInput!): Task!
updateTask(input: UpdateTaskInput!): Task!
deleteTask(input: DeleteTaskInput!): Task!
}
type Subscription {
taskCreated: Task!
taskChanged(id: ID!): Task!
}
type User {
id: ID!
name: String!
email: String!
"""
All tasks that have been created by this user.
"""
createdTasks: [Task!]!
"""
All tasks that have this user set as the assignee.
"""
assignedTasks: [Task!]!
}
enum TaskStatus {
TODO
IN_PROGRESS
DONE
}
type Task {
id: ID!
createdByUserId: ID!
createdBy: User!
"""
Private tasks can be viewed and modified only by the assignee or the user who created it.
"""
private: Boolean!
assigneeUserId: ID
assignee: User
status: TaskStatus!
title: String!
description: String
}
input RegisterInput {
name: String!
email: String!
password: String!
}
input CreateTaskInput {
private: Boolean!
assignee: ID!
status: TaskStatus! = TODO
title: String!
description: String
}
input UpdateTaskInput {
id: ID!
private: Boolean!
assignee: ID!
status: TaskStatus!
title: String!
description: String
}
input DeleteTaskInput {
id: ID!
}