2023-10-10 22:26:07 +02:00
|
|
|
# you first have to add a user to create todos
|
|
|
|
|
|
|
|
query getUser {
|
2023-10-20 13:59:19 +02:00
|
|
|
user(id: 1) {
|
|
|
|
id
|
|
|
|
userName
|
|
|
|
fullName
|
|
|
|
todos {
|
|
|
|
id
|
|
|
|
text
|
|
|
|
done
|
|
|
|
}
|
|
|
|
}
|
2023-10-10 22:26:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
query getTodo {
|
2023-10-20 13:59:19 +02:00
|
|
|
todo(id: 1) {
|
|
|
|
id
|
|
|
|
text
|
|
|
|
done
|
|
|
|
}
|
2023-10-10 22:26:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
query getTodos {
|
2023-10-20 13:59:19 +02:00
|
|
|
todos {
|
|
|
|
id
|
|
|
|
text
|
|
|
|
done
|
|
|
|
user {
|
|
|
|
id
|
|
|
|
userName
|
|
|
|
fullName
|
|
|
|
todos {
|
|
|
|
id # you could continue this
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-10-10 22:26:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
query getUsers {
|
2023-10-20 13:59:19 +02:00
|
|
|
users {
|
|
|
|
id
|
|
|
|
userName
|
|
|
|
fullName
|
|
|
|
todos {
|
|
|
|
id # ...and this too
|
|
|
|
}
|
|
|
|
}
|
2023-10-10 22:26:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mutation createTodo {
|
2023-10-20 13:59:19 +02:00
|
|
|
createTodo(input: { userId: 2, text: "adding a router and CSRF header" }) {
|
|
|
|
id
|
|
|
|
text
|
|
|
|
done
|
|
|
|
}
|
2023-10-10 22:26:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mutation updateTodo {
|
2023-10-20 13:59:19 +02:00
|
|
|
updateTodo(id: 1, changes: { done: true }) {
|
|
|
|
id
|
|
|
|
text
|
|
|
|
done
|
|
|
|
}
|
2023-10-10 22:26:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mutation createUser {
|
2023-10-20 13:59:19 +02:00
|
|
|
createUser(input: { userName: "1234Lorem", fullName: "Lorem I." }) {
|
|
|
|
id
|
|
|
|
}
|
2023-10-10 22:26:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mutation updateUser {
|
2023-10-20 13:59:19 +02:00
|
|
|
updateUser(id: "1", changes: { fullName: "Lorem Ipsum" }) {
|
|
|
|
fullName
|
|
|
|
}
|
2023-10-10 22:26:07 +02:00
|
|
|
}
|