-
Notifications
You must be signed in to change notification settings - Fork 4
/
schema.graphql
263 lines (257 loc) · 6.66 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
directive @goField(forceResolver: Boolean, name: String) on FIELD_DEFINITION | INPUT_FIELD_DEFINITION
directive @goModel(model: String, models: [String!]) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION
"""Create a new todo todo."""
input CreateTodoInput {
"""The name of the todo."""
name: String!
"""The description of the todo."""
description: String
"""The ID for the tenant for this todo."""
tenantID: ID!
}
"""
Define a Relay Cursor type:
https://relay.dev/graphql/connections.htm#sec-Cursor
"""
scalar Cursor
"""A valid JSON string."""
scalar JSON
type Mutation {
"""Create a new todo"""
todoCreate(
"""Name of the todo"""
input: CreateTodoInput!
): TodoCreatePayload!
"""Update an existing todo"""
todoUpdate(
"""ID of the todo"""
id: ID!
"""Name of the todo"""
input: UpdateTodoInput!
): TodoUpdatePayload!
"""Delete an existing todo"""
todoDelete(
"""ID of the todo"""
id: ID!
): TodoDeletePayload!
}
"""
An object with an ID.
Follows the [Relay Global Object Identification Specification](https://relay.dev/graphql/objectidentification.htm)
"""
interface Node {
"""The id of the object."""
id: ID!
}
"""Possible directions in which to order a list of items when provided an `orderBy` argument."""
enum OrderDirection {
"""Specifies an ascending order for a given `orderBy` argument."""
ASC
"""Specifies a descending order for a given `orderBy` argument."""
DESC
}
"""
Information about pagination in a connection.
https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo
"""
type PageInfo @shareable {
"""When paginating forwards, are there more items?"""
hasNextPage: Boolean!
"""When paginating backwards, are there more items?"""
hasPreviousPage: Boolean!
"""When paginating backwards, the cursor to continue."""
startCursor: Cursor
"""When paginating forwards, the cursor to continue."""
endCursor: Cursor
}
type Query {
"""Look up todo by ID"""
todo(
"""ID of the todo"""
id: ID!
): Todo!
_entities(representations: [_Any!]!): [_Entity]!
_service: _Service!
}
type Tenant @key(fields: "id") {
id: ID! @external
todo(
"""Returns the elements in the list that come after the specified cursor."""
after: Cursor
"""Returns the first _n_ elements from the list."""
first: Int
"""Returns the elements in the list that come before the specified cursor."""
before: Cursor
"""Returns the last _n_ elements from the list."""
last: Int
"""Ordering options for Todo returned from the connection."""
orderBy: TodoOrder
"""Filtering options for Todo returned from the connection."""
where: TodoWhereInput
): TodoConnection! @goField(forceResolver: true)
}
"""The builtin Time type"""
scalar Time
type Todo implements Node @key(fields: "id") {
"""The ID of the Todo."""
id: ID!
createdAt: Time!
updatedAt: Time!
"""The name of the todo."""
name: String!
"""The description of the todo."""
description: String
"""The tenant of the todo."""
tenant: Tenant! @goField(forceResolver: true)
}
"""A connection to a list of items."""
type TodoConnection {
"""A list of edges."""
edges: [TodoEdge]
"""Information to aid in pagination."""
pageInfo: PageInfo!
"""Identifies the total count of items in the connection."""
totalCount: Int!
}
"""Return response for createTodo mutation"""
type TodoCreatePayload {
"""Created todo"""
todo: Todo!
}
"""Return response for deleteTodo mutation"""
type TodoDeletePayload {
"""Deleted todo"""
deletedID: ID!
}
"""An edge in a connection."""
type TodoEdge {
"""The item at the end of the edge."""
node: Todo
"""A cursor for use in pagination."""
cursor: Cursor!
}
"""Ordering options for Todo connections"""
input TodoOrder {
"""The ordering direction."""
direction: OrderDirection! = ASC
"""The field by which to order Todos."""
field: TodoOrderField!
}
"""Properties by which Todo connections can be ordered."""
enum TodoOrderField {
ID
CREATED_AT
UPDATED_AT
NAME
DESCRIPTION
TENANT
}
"""Return response for updateTodo mutation"""
type TodoUpdatePayload {
"""Updated todo"""
todo: Todo!
}
"""
TodoWhereInput is used for filtering Todo objects.
Input was generated by ent.
"""
input TodoWhereInput {
not: TodoWhereInput
and: [TodoWhereInput!]
or: [TodoWhereInput!]
"""id field predicates"""
id: ID
idNEQ: ID
idIn: [ID!]
idNotIn: [ID!]
idGT: ID
idGTE: ID
idLT: ID
idLTE: ID
"""created_at field predicates"""
createdAt: Time
createdAtNEQ: Time
createdAtIn: [Time!]
createdAtNotIn: [Time!]
createdAtGT: Time
createdAtGTE: Time
createdAtLT: Time
createdAtLTE: Time
"""updated_at field predicates"""
updatedAt: Time
updatedAtNEQ: Time
updatedAtIn: [Time!]
updatedAtNotIn: [Time!]
updatedAtGT: Time
updatedAtGTE: Time
updatedAtLT: Time
updatedAtLTE: Time
"""name field predicates"""
name: String
nameNEQ: String
nameIn: [String!]
nameNotIn: [String!]
nameGT: String
nameGTE: String
nameLT: String
nameLTE: String
nameContains: String
nameHasPrefix: String
nameHasSuffix: String
nameEqualFold: String
nameContainsFold: String
"""description field predicates"""
description: String
descriptionNEQ: String
descriptionIn: [String!]
descriptionNotIn: [String!]
descriptionGT: String
descriptionGTE: String
descriptionLT: String
descriptionLTE: String
descriptionContains: String
descriptionHasPrefix: String
descriptionHasSuffix: String
descriptionIsNil: Boolean
descriptionNotNil: Boolean
descriptionEqualFold: String
descriptionContainsFold: String
}
"""Update an existing todo todo."""
input UpdateTodoInput {
"""The name of the todo."""
name: String
"""The description of the todo."""
description: String
clearDescription: Boolean
}
union _Entity = Tenant | Todo
type _Service {
sdl: String
}
scalar _Any
scalar FieldSet
directive @requires(fields: FieldSet!) on FIELD_DEFINITION
directive @provides(fields: FieldSet!) on FIELD_DEFINITION
directive @extends on OBJECT | INTERFACE
directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE
directive @link(import: [String!], url: String!) repeatable on SCHEMA
directive @external on FIELD_DEFINITION | OBJECT
directive @shareable on OBJECT | FIELD_DEFINITION
directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
directive @override(from: String!) on FIELD_DEFINITION
directive @inaccessible on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
#directive @interfaceObject on OBJECT
extend schema
@link(
url: "https://specs.apollo.dev/federation/v2.3"
import: [
"@key",
"@external",
"@shareable",
"@tag",
"@override",
"@inaccessible",
"@interfaceObject"
]
)