-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
56 lines (47 loc) · 970 Bytes
/
schema.graphql
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
type Query {
me: User
todo(todoID: ID!): Todo
todos(page: Int, length: Int): Todos
searchTodo(needle: String!, page: Int, length: Int): Todos
completedTodos(page: Int, length: Int): Todos
}
type Mutation {
signup(email: String!, password: String!): AuthPayload
login(email: String!, password: String!): AuthPayload
saveTodo(id: ID, title: String!, completed: Boolean): Todo
toggleTodoCompleted(todoID: ID!): Todo
deleteTodo(todoID: ID!): Todo
clearTodos: Int!
}
interface WithPage {
pageInfo: PageInfo!
nodes: [Node!]!
}
type PageInfo {
hasNextPage: Boolean!
index: Int!
maxLength: Int!
pageCount: Int!
totalCount: Int!
}
type Todos implements WithPage {
pageInfo: PageInfo!
nodes: [Todo!]!
}
type Todo {
id: ID!
title: String!
completed: Boolean
}
union Node = Todo
type AuthPayload {
token: String!
user: User!
}
type User {
id: ID!
email: String!
name: String!
createdAt: DateTime!
}
scalar DateTime