-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.py
64 lines (56 loc) · 1.28 KB
/
schema.py
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
from ariadne import gql
type_defs = gql("""
scalar Datetime
type User {
id: Int!
name: String!
email: String!
password: String!
created_at: Datetime!
todos: [Todo]
}
type Todo {
id: Int!
text: String!
is_done: Boolean!
created_at: Datetime!
created_by: User!
owner: User!
}
input AddUserInput {
name: String!
email: String!
password: String!
}
input AddTodoInput {
text: String!
created_by: Int!
is_done: Boolean!
}
input UpdateUserInput {
id: Int!
name: String
email: String
password: String
}
input UpdateTodoInput {
id: Int!
text: String
is_done: Boolean
}
type Mutation {
addUser(user: AddUserInput!): User!
deleteUser(userId: Int!): Boolean
updateUser(user: UpdateUserInput!): User!
addTodo(todo: AddTodoInput!): Todo!
deleteTodo(todoId: Int!): Boolean
updateTodo(todo: UpdateTodoInput!): Todo!
}
type Query {
todos: [Todo!]
users: [User!]
todo(todoId: Int!): Todo
getTodosByUser(userId: Int!): [Todo!]
user(userId: Int!): User
}
""")