-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
74 lines (62 loc) · 1.31 KB
/
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
scalar Time
# Generic type and input
"Pagination is default input Pagination"
input Pagination {
first : Int!
offset : Int!
after : ID
query : String!
sort : [String!]!
}
"Object that is being paginated"
type PaginationEdge {
node : User!
cursor : ID!
}
"Information about pagination"
type PaginationInfo {
endCursor : ID!
hasNextPage : Boolean!
}
"Result while querying list using graphql"
type PaginationResultUser {
totalCount: Int!
edges : [PaginationEdge!]!
pageInfo : PaginationInfo!
}
# End of generic type and input
"Type for User"
type User {
id : ID!
nik: String!
nama: String!
alamat: String!
jenis_kelamin: String!
tanggal_lahir: String!
agama: String!
created_at: Time
updated_at: Time
}
type Query {
user: [User!]!
pagination : [Pagination!]!
}
"Input body for update and input user"
input NewUser{
nik: String!
nama: String!
alamat: String!
jenis_kelamin: String!
tanggal_lahir: String!
agama: String!
}
"CRUD for User"
type Mutation{
"This function creates a new user to database"
createUser(input: NewUser): User!
"This function update a user from database specified by id"
updateUser(id: ID!, input: NewUser): User!
"This function delete a user from database specified by id"
deleteUser(id: ID!): Boolean!
getPagination(input : Pagination) : PaginationResultUser!
}