-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathschema.graphql
More file actions
263 lines (201 loc) · 4.69 KB
/
Copy pathschema.graphql
File metadata and controls
263 lines (201 loc) · 4.69 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
"""A long-form article with excerpt and category."""
type Article implements Content {
author: User
"""Full article body."""
body: String!
"""Article category."""
category: String!
"""Short excerpt for previews."""
excerpt: String!
id: ID!
publishedAt: String
slug: String!
title: String!
}
"""A blog post with tags."""
type BlogPost implements Content {
author: User
"""The blog post content."""
content: String!
id: ID!
publishedAt: String
slug: String!
"""Tags for categorization."""
tags: [String!]!
title: String!
}
"""Base interface for all content types in the CMS."""
interface Content {
"""The author of the content."""
author: User
"""Unique identifier for the content."""
id: ID!
"""When the content was published. Null if draft."""
publishedAt: String
"""URL-friendly slug."""
slug: String!
"""The title of the content."""
title: String!
}
type DataForLayer {
text: String
}
type FormSubmission {
documents: [FormSubmissionDocument]
firstName: String
id: String!
lastName: String
}
type FormSubmissionDocument {
file: UploadedFile!
name: String
}
input FormSubmissionDocumentsInput {
file: Upload!
name: String
}
input FormSubmissionInput {
documents: [FormSubmissionDocumentsInput]
firstName: String
lastName: String
}
enum MeansOfContact {
email
phone
}
type Mutation {
createUser(user: UserData!): User!
deleteUser(id: Int!): Boolean
initState: Boolean!
submitForm(input: FormSubmissionInput!): Boolean!
triggerError: Boolean
uploadFile(file: Upload): Boolean!
}
type NewsEntityQueryResult {
items: [NewsItem]
}
type NewsItem {
date: String
lead: String
organizationId: String!
title: String
url: NewsUrl
}
type NewsUrl {
path: String
}
type Organization {
id: String!
name: String!
}
"""A static page with a template."""
type Page implements Content {
author: User
"""The page content."""
content: String!
id: ID!
publishedAt: String
slug: String!
"""Template to use for rendering."""
template: String!
title: String!
}
type Query {
"""Get all content items (articles, blog posts, pages)."""
allContent: [Content!]!
"""Get all articles."""
articles: [Article!]!
"""Get all blog posts."""
blogPosts: [BlogPost!]!
"""Get content by slug."""
contentBySlug(slug: String!): Content
dataForLayer: DataForLayer
foobar: String
"""Get the current time."""
getCurrentTime: String
"""Produce a GraphQL error."""
getError: Boolean
"""Returns the value of a request header."""
getRequestHeader(name: String!): String
"""Get all submissions."""
getSubmissions: [FormSubmission]
getText(text: String!): String!
"""
Get news items, optionally filtered by organization IDs.
Returns all news if ouIds is null.
"""
newsEntityQuery(limit: Int, ouIds: [String]): NewsEntityQueryResult!
"""Get all pages."""
pages: [Page!]!
"""Returns a random number."""
returnRandomNumber: Int!
"""Returns the same value."""
returnSameValue(value: Int!, vary: String): Int!
"""Search across all content types and users."""
search(query: String!): [SearchResult!]!
"""Test the client options."""
testClientOptions(path: String!): TestClientOptions
"""Test the fetch options."""
testFetchOptions: TestFetchOptions
"""Load a user by ID."""
userById(id: ID!): User
"""Get all users."""
users: [User!]!
"""Get users with pagination metadata."""
usersPaginated(limit: Int, offset: Int): UsersResult!
}
"""Union type for search results."""
union SearchResult = Article | BlogPost | Page | User
type TestClientOptions {
language: String
languageFromPath: String
}
type TestFetchOptions {
headerClient: String
headerServer: String
}
"""The `Upload` scalar type represents a file upload."""
scalar Upload
type UploadedFile {
content: String!
id: String!
name: String!
}
type User {
"""Number of articles written by the user."""
articleCount: Int!
"""Date of birth as YYYY-MM-DD."""
dateOfBirth: String
"""Description."""
description: String
"""Email address."""
email: String!
"""First name of the user."""
firstName: String!
"""All their friends."""
friends: [User]
"""The ID of the user."""
id: Int!
"""Last name of the user."""
lastName: String!
"""How the user likes to be contacted."""
meansOfContact: MeansOfContact
triggerError: Boolean
}
input UserData {
dateOfBirth: String
description: String
email: String!
firstName: String!
lastName: String!
}
type UsersResult {
"""Current page limit."""
limit: Int!
"""Current page offset."""
offset: Int!
"""Total number of users available."""
totalCount: Int!
"""List of users for the current page."""
users: [User!]!
}