-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathschema.graphql
282 lines (248 loc) · 7.02 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
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
# This file was generated based on ".graphqlconfig". Do not edit manually.
schema {
query: Query
mutation: Mutation
}
"""
The canvas contains all nodes and edges.
Nodes and edges are not represented because they're complex shapes,
and because we won't query them using GQL anyway. (we use GQL for that)
"""
type Canvas {
"The document's ID."
_id: ID!
"The document's timestamp."
_ts: Long!
id: ID!
lastUpdatedBySessionEphemeralId: String
lastUpdatedByUserName: String
owner: User!
project: Project!
}
"The pagination object for elements of type 'Canvas'."
type CanvasPage {
"A cursor for elements coming after the current page."
after: String
"A cursor for elements coming before the current page."
before: String
"The elements of type 'Canvas' in this page."
data: [Canvas]!
}
type Mutation {
"Create a new document in the collection of 'Canvas'"
createCanvas(
"'Canvas' input values"
data: CanvasInput!
): Canvas!
"Create a new document in the collection of 'Project'"
createProject(
"'Project' input values"
data: ProjectInput!
): Project!
"Create a new document in the collection of 'User'"
createUser(
"'User' input values"
data: UserInput!
): User!
"Delete an existing document in the collection of 'Canvas'"
deleteCanvas(
"The 'Canvas' document's ID"
id: ID!
): Canvas
"Delete an existing document in the collection of 'Project'"
deleteProject(
"The 'Project' document's ID"
id: ID!
): Project
"Delete an existing document in the collection of 'User'"
deleteUser(
"The 'User' document's ID"
id: ID!
): User
"Update an existing document in the collection of 'Canvas'"
updateCanvas(
"'Canvas' input values"
data: CanvasInput!,
"The 'Canvas' document's ID"
id: ID!
): Canvas
"Update an existing document in the collection of 'Project'"
updateProject(
"'Project' input values"
data: ProjectInput!,
"The 'Project' document's ID"
id: ID!
): Project
"Update an existing document in the collection of 'User'"
updateUser(
"'User' input values"
data: UserInput!,
"The 'User' document's ID"
id: ID!
): User
}
"""
A project **belongs** to a user and is related to a canvas.
A project can be considered as Canvas metadata.
"""
type Project {
"The document's ID."
_id: ID!
"The document's timestamp."
_ts: Long!
canvas: Canvas
id: ID!
"Name of the project"
label: String!
owner: User!
}
"The pagination object for elements of type 'Project'."
type ProjectPage {
"A cursor for elements coming after the current page."
after: String
"A cursor for elements coming before the current page."
before: String
"The elements of type 'Project' in this page."
data: [Project]!
}
type Query {
"Find a document from the collection of 'Canvas' by its id."
findCanvasByID(
"The 'Canvas' document's ID"
id: ID!
): Canvas
"Find a document from the collection of 'Project' by its id."
findProjectByID(
"The 'Project' document's ID"
id: ID!
): Project
findProjectsByUserId(id: ID!): [Project!]
findUserByEmail(email: String!): User
"Find a document from the collection of 'User' by its id."
findUserByID(
"The 'User' document's ID"
id: ID!
): User
}
"""
###################### FaunaDB internals
directive @embedded on OBJECT
directive @collection(
name: String!
) on OBJECT
directive @index(
name: String!
) on FIELD_DEFINITION
directive @resolver(
name: String
paginated: Boolean! = false
) on FIELD_DEFINITION
directive @relation(
name: String
) on FIELD_DEFINITION
directive @unique(
index: String
) on FIELD_DEFINITION
scalar Date
scalar Long
scalar Time
schema{
query: Query
}
###################### Custom
"""
type User {
"The document's ID."
_id: ID!
"The document's timestamp."
_ts: Long!
canvases(
"The pagination cursor."
_cursor: String,
"The number of items to return per page."
_size: Int
): CanvasPage!
email: String!
id: ID!
projects(
"The pagination cursor."
_cursor: String,
"The number of items to return per page."
_size: Int
): ProjectPage!
}
"'Canvas' input values"
input CanvasInput {
id: ID!
lastUpdatedBySessionEphemeralId: String
lastUpdatedByUserName: String
owner: CanvasOwnerRelation
project: CanvasProjectRelation
}
"Allow manipulating the relationship between the types 'Canvas' and 'User' using the field 'Canvas.owner'."
input CanvasOwnerRelation {
"Connect a document of type 'User' with the current document using its ID."
connect: ID
"Create a document of type 'User' and associate it with the current document."
create: UserInput
}
"Allow manipulating the relationship between the types 'Canvas' and 'Project' using the field 'Canvas.project'."
input CanvasProjectRelation {
"Connect a document of type 'Project' with the current document using its ID."
connect: ID
"Create a document of type 'Project' and associate it with the current document."
create: ProjectInput
"If true, disconnects this document from 'Project'"
disconnect: Boolean
}
"Allow manipulating the relationship between the types 'Project' and 'Canvas' using the field 'Project.canvas'."
input ProjectCanvasRelation {
"Connect a document of type 'Canvas' with the current document using its ID."
connect: ID
"Create a document of type 'Canvas' and associate it with the current document."
create: CanvasInput
}
"'Project' input values"
input ProjectInput {
canvas: ProjectCanvasRelation
id: ID!
"Name of the project"
label: String!
owner: ProjectOwnerRelation
}
"Allow manipulating the relationship between the types 'Project' and 'User' using the field 'Project.owner'."
input ProjectOwnerRelation {
"Connect a document of type 'User' with the current document using its ID."
connect: ID
"Create a document of type 'User' and associate it with the current document."
create: UserInput
}
"Allow manipulating the relationship between the types 'User' and 'Canvas'."
input UserCanvasesRelation {
"Connect one or more documents of type 'Canvas' with the current document using their IDs."
connect: [ID]
"Create one or more documents of type 'Canvas' and associate them with the current document."
create: [CanvasInput]
"Disconnect the given documents of type 'Canvas' from the current document using their IDs."
disconnect: [ID]
}
"'User' input values"
input UserInput {
canvases: UserCanvasesRelation
email: String!
id: ID!
projects: UserProjectsRelation
}
"Allow manipulating the relationship between the types 'User' and 'Project'."
input UserProjectsRelation {
"Connect one or more documents of type 'Project' with the current document using their IDs."
connect: [ID]
"Create one or more documents of type 'Project' and associate them with the current document."
create: [ProjectInput]
"Disconnect the given documents of type 'Project' from the current document using their IDs."
disconnect: [ID]
}
scalar Date
scalar Time
"The `Long` scalar type represents non-fractional signed whole numeric values. Long can represent values between -(2^63) and 2^63 - 1."
scalar Long