-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.graphql
More file actions
331 lines (301 loc) · 6.55 KB
/
schema.graphql
File metadata and controls
331 lines (301 loc) · 6.55 KB
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
"""
A directive that specifies that a field cannot have a null value.
"""
directive @notNull on INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
"""
A directive that enforces that an input field or argument value must not be empty.
"""
directive @notEmpty on INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
"""
A directive that specifies a numeric range for a field's value.
The field's value must be within the specified minimum and maximum (inclusive) bounds.
"""
directive @range(
"""
The minimum value allowed for the field. Defaults to 0 if not provided.
"""
min: Int = 0,
"""
The maximum value allowed for the field. Defaults to positive infinity if not provided.
"""
max: Int = Infinity
) on INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
"""
A directive that specifies a length range for an input field or argument value.
The value's length must be within the specified minimum and maximum (inclusive) bounds.
"""
directive @length(
"""
The minimum length allowed for the value. Defaults to 0 if not provided.
"""
min: Int = 0,
"""
The maximum length allowed for the value. Defaults to positive infinity if not provided.
"""
max: Int = Infinity
) on INPUT_FIELD_DEFINITION | ARGUMENT_DEFINITION
"""
A date string, such as 2007-12-03, compliant with the `full-date`
format outlined in section 5.6 of the RFC 3339 profile of the
ISO 8601 standard for representation of dates and times using
the Gregorian calendar.
"""
scalar Date
"""
A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt.
"""
scalar URL
"""
A field whose value is a generic Universally Unique Identifier: https://en.wikipedia.org/wiki/Universally_unique_identifier.
"""
scalar UUID
enum PageTypeEnum {
"""
Represents a PDF document.
"""
PDF
"""
Represents a JPEG image.
"""
JPEG
"""
Represents a PNG image.
"""
PNG
"""
Represents a WEBP image.
"""
WEBP
}
type Page {
"""
The unique identifier for the page.
"""
id: UUID!
"""
The type of the page (e.g., PDF, JPEG, etc.).
"""
type: PageTypeEnum!
"""
The date on which page was created
"""
date: Date!
"""
The URL of the website.
"""
site: URL!
"""
The URL of the page's file.
"""
file: URL!
}
type PageEdge {
"""
The actual page data.
"""
node: Page!
"""
A cursor for pagination purposes.
"""
cursor: UUID!
}
type Pages {
"""
A list of page edges.
"""
edges: [PageEdge!]!
"""
Information about pagination.
"""
pageInfo: PageInfo!
}
type PageInfo {
"""
Indicates if there are more pages after the current set.
"""
hasNextPage: Boolean!
"""
Indicates if there are more pages before the current set.
"""
hasPreviousPage: Boolean!
"""
The cursor marking the start of the current set.
"""
startCursor: UUID
"""
The cursor marking the end of the current set.
"""
endCursor: UUID
}
input PageTypeEnumFilter {
"""
Filters for pages with the specified type.
"""
eq: PageTypeEnum @notNull
"""
Filters for pages not of the specified type.
"""
ne: PageTypeEnum @notNull
"""
Filters for pages with types in the specified list.
"""
in: [PageTypeEnum!] @notNull @length(min: 1)
"""
Filters for pages not in the specified list of types.
"""
nin: [PageTypeEnum!] @notNull @length(min: 1)
}
input DateFilter {
"""
Filters for dates greater than the specified value.
"""
gt: Date @notNull
"""
Filters for dates less than the specified value.
"""
lt: Date @notNull
"""
Filters for dates greater than or equal to the specified value.
"""
gte: Date @notNull
"""
Filters for dates less than or equal to the specified value.
"""
lte: Date @notNull
}
input PageFilterInput {
"""
Filters for pages based on their types.
"""
type: PageTypeEnumFilter @notNull
"""
Filters for pages based on date ranges.
"""
date: DateFilter @notNull
}
enum SortFieldEnum {
"""
Sort by page type
"""
TYPE
"""
Sort by page date
"""
DATE
"""
Sort by page site
"""
SITE
"""
Sort by page file
"""
FILE
}
enum SortOrderEnum {
"""
Sort in ascending order
"""
ASC
"""
Sort in descending order
"""
DESC
}
input PageSortInput {
"""
Specify the field to sort by
"""
field: SortFieldEnum!
"""
Specify the sorting order
"""
order: SortOrderEnum!
}
interface BaseError {
message: String!
}
type InputFieldValidation {
field: String!
message: String!
}
type InvalidInputError implements BaseError {
message: String!
inputs: [InputFieldValidation!]!
}
type NotFoundError implements BaseError {
message: String!
}
type UnknownError implements BaseError {
message: String!
}
union PageResult = Page | InvalidInputError | NotFoundError | UnknownError
union PagesResult = Pages | InvalidInputError | UnknownError
type Query {
"""
Retrieves a list of pages.
"""
pages(
"""
Retrieves the first N pages.
"""
first: Int @notNull @range(min: 0, max: 10000),
"""
Retrieves the last N pages.
"""
last: Int @notNull @range(min: 0, max: 10000),
"""
Retrieves pages before the specified cursor.
"""
before: UUID @notNull,
"""
Retrieves pages after the specified cursor.
"""
after: UUID @notNull,
"""
Applies filters to page retrieval.
"""
filter: PageFilterInput @notNull
"""
Specifies the sorting order for the retrieved pages.
"""
sort: PageSortInput @notNull
): PagesResult!
"""
Retrieves a specific page by its ID.
"""
page(id: UUID!): PageResult!
}
input CreatePageInput {
"""
The type of the page.
"""
type: PageTypeEnum!
"""
The URL of the website for the new page.
"""
site: URL!
}
input UpdatePageInput {
"""
The type of the page.
"""
type: PageTypeEnum @notNull
"""
The URL of the website for the new page.
"""
site: URL @notNull
}
type Mutation {
"""
Creates a new page.
"""
createPage(input: CreatePageInput!): PageResult!
"""
Updates a page.
"""
updatePage(id: UUID!, input: UpdatePageInput! @notEmpty): PageResult!
"""
Deletes a page.
"""
deletePage(id: UUID!): PageResult!
}