-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathent.graphql
More file actions
199 lines (194 loc) · 4.79 KB
/
ent.graphql
File metadata and controls
199 lines (194 loc) · 4.79 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
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
"""
CreateTodoInput is used for create Todo object.
Input was generated by ent.
"""
input CreateTodoInput {
text: String!
createdAt: Time
status: TodoStatus
priority: Int
childIDs: [ID!]
parentID: ID
}
"""
Define a Relay Cursor type:
https://relay.dev/graphql/connections.htm#sec-Cursor
"""
scalar Cursor
"""
An object with an ID.
Follows the [Relay Global Object Identification Specification](https://relay.dev/graphql/objectidentification.htm)
"""
interface Node @goModel(model: "todo/ent.Noder") {
"""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 {
"""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 {
"""Fetches an object given its ID."""
node(
"""ID of the object."""
id: ID!
): Node
"""Lookup nodes by a list of IDs."""
nodes(
"""The list of node IDs."""
ids: [ID!]!
): [Node]!
todos(
"""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 Todos returned from the connection."""
orderBy: TodoOrder
"""Filtering options for Todos returned from the connection."""
where: TodoWhereInput
): TodoConnection!
}
"""The builtin Time type"""
scalar Time
type Todo implements Node {
id: ID!
text: String!
createdAt: Time!
status: TodoStatus!
priority: Int!
children: [Todo!]
parent: Todo
}
"""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!
}
"""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 {
TEXT
CREATED_AT
STATUS
PRIORITY
}
"""TodoStatus is enum for the field status"""
enum TodoStatus @goModel(model: "todo/ent/todo.Status") {
IN_PROGRESS
COMPLETED
}
"""
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
"""text field predicates"""
text: String
textNEQ: String
textIn: [String!]
textNotIn: [String!]
textGT: String
textGTE: String
textLT: String
textLTE: String
textContains: String
textHasPrefix: String
textHasSuffix: String
textEqualFold: String
textContainsFold: String
"""created_at field predicates"""
createdAt: Time
createdAtNEQ: Time
createdAtIn: [Time!]
createdAtNotIn: [Time!]
createdAtGT: Time
createdAtGTE: Time
createdAtLT: Time
createdAtLTE: Time
"""status field predicates"""
status: TodoStatus
statusNEQ: TodoStatus
statusIn: [TodoStatus!]
statusNotIn: [TodoStatus!]
"""priority field predicates"""
priority: Int
priorityNEQ: Int
priorityIn: [Int!]
priorityNotIn: [Int!]
priorityGT: Int
priorityGTE: Int
priorityLT: Int
priorityLTE: Int
"""children edge predicates"""
hasChildren: Boolean
hasChildrenWith: [TodoWhereInput!]
"""parent edge predicates"""
hasParent: Boolean
hasParentWith: [TodoWhereInput!]
}
"""
UpdateTodoInput is used for update Todo object.
Input was generated by ent.
"""
input UpdateTodoInput {
text: String
status: TodoStatus
priority: Int
addChildIDs: [ID!]
removeChildIDs: [ID!]
clearParent: Boolean
parentID: ID
}