-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.gql
166 lines (124 loc) · 2.72 KB
/
schema.gql
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# ------------------------------------------------------
# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
# ------------------------------------------------------
type Article {
"""Id field"""
id: String!
"""Title field"""
title: String!
"""Description field"""
description: String!
"""User field"""
user: User!
"""createdAt field"""
createdAt: DateTime!
"""updatedAt field"""
updatedAt: DateTime!
}
"""
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.
"""
scalar DateTime
type User {
"""Id field"""
id: String!
"""Name field"""
name: String!
"""Username field"""
username: String!
"""Email field"""
email: String!
"""Articles field"""
articles: [Article!]!
"""createdAt field"""
createdAt: DateTime!
"""updatedAt field"""
updatedAt: DateTime!
}
type ArticlePaginationResponse {
"""Count field"""
count: Int!
"""Articles field"""
list: [Article!]!
}
type UserPaginationResponse {
"""Count field"""
count: Int!
"""Users field"""
list: [User!]!
}
type LoginUserResponse {
"""Id field"""
id: String!
"""Name field"""
name: String!
"""Token field"""
token: String!
}
type Query {
users(param: PaginationParam!): UserPaginationResponse!
user(id: String!): User!
articles(param: PaginationParam!): ArticlePaginationResponse!
article(id: String!): Article!
}
input PaginationParam {
"""Limit field"""
limit: Int
"""Offset field"""
offset: Int
"""OrderBy field"""
orderBy: String
"""OrderType field"""
orderType: String
"""Q field"""
q: String
}
type Mutation {
updateUser(input: UpdateUserInput!, id: String!): User!
removeUser(id: String!): User!
restoreUser(id: String!): User!
register(input: RegisterUserInput!): User!
login(input: LoginUserInput!): LoginUserResponse!
createArticle(input: CreateArticleInput!): Article!
updateArticle(input: UpdateArticleInput!, id: String!): Article!
removeArticle(id: String!): Article!
restoreArticle(id: String!): Article!
}
input UpdateUserInput {
"""Name field"""
name: String
"""Password field"""
password: String
"""Email field"""
email: String
"""Username field"""
username: String
}
input RegisterUserInput {
"""Name field"""
name: String!
"""Password field"""
password: String!
"""Email field"""
email: String!
"""Username field"""
username: String!
}
input LoginUserInput {
"""Username field"""
username: String!
"""Password field"""
password: String!
}
input CreateArticleInput {
"""Title field"""
title: String!
"""Description field"""
description: String!
}
input UpdateArticleInput {
"""Title field"""
title: String
"""Description field"""
description: String
}