-
Notifications
You must be signed in to change notification settings - Fork 0
/
query_examples
65 lines (54 loc) · 900 Bytes
/
query_examples
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
# To fetch all the todos
query fetchAllTodos {
todos {
success
errors
todos {
description
completed
id
}
}
}
# To fetch a todo with id 1
query fetchTodo {
todo(todoId: "1") {
success
errors
todo { id completed description dueDate }
}
}
# To create a new todo
mutation newTodo {
createTodo(description:"Go to the dentist", dueDate:"24-10-2020") {
success
errors
todo {
id
completed
description
}
}
}
# To get a todo marked done
mutation markDone {
markDone(todoId: "1") {
success
errors
todo { id completed description dueDate }
}
}
# To delete a todo with the given id
mutation {
deleteTodo(todoId: "1") {
success
errors
}
}
# To update the due date for a todo
mutation updateDueDate {
updateDueDate(todoId: "2", newDate: "25-10-2020") {
success
errors
}
}