schema.graphql

  1schema {
  2  query: RootQuery
  3}
  4
  5scalar Time
  6scalar Label
  7
  8# Information about pagination in a connection.
  9type PageInfo {
 10  # When paginating forwards, are there more items?
 11  hasNextPage: Boolean!
 12
 13  # When paginating backwards, are there more items?
 14  hasPreviousPage: Boolean!
 15
 16  # When paginating backwards, the cursor to continue.
 17  startCursor: String
 18
 19  # When paginating forwards, the cursor to continue.
 20  endCursor: String
 21}
 22
 23# Represents an person in a git object.
 24type Person {
 25  # The email of the person.
 26  email: String
 27
 28  # The name of the person.
 29  name: String
 30}
 31
 32
 33type CommentConnection {
 34  edges: [CommentEdge]
 35  nodes: [Comment]
 36  pageInfo: PageInfo!
 37  totalCount: Int!
 38}
 39
 40type CommentEdge {
 41  cursor: String!
 42  node: Comment!
 43}
 44
 45interface Commentable {
 46  # A list of comments associated with the object.
 47  comments(
 48    # Returns the elements in the list that come after the specified cursor.
 49    after: String
 50
 51    # Returns the elements in the list that come before the specified cursor.
 52    before: String
 53
 54    # Returns the first _n_ elements from the list.
 55    first: Int
 56
 57    # Returns the last _n_ elements from the list.
 58    last: Int
 59  ): CommentConnection!
 60}
 61
 62# Represents a comment on a bug.
 63type Comment implements Authored {
 64  # The author of this comment.
 65  author: Person!
 66
 67  # The message of this comment.
 68  message: String!
 69}
 70
 71enum Status {
 72  OPEN
 73  CLOSED
 74}
 75
 76# An object that has an author.
 77interface Authored {
 78  # The author of this object.
 79  author: Person!
 80}
 81
 82type OperationConnection {
 83  edges: [OperationEdge]!
 84  nodes: [OperationUnion]!
 85  pageInfo: PageInfo!
 86  totalCount: Int!
 87}
 88
 89type OperationEdge {
 90  cursor: String!
 91  node: OperationUnion
 92}
 93
 94# An operation applied to a bug.
 95interface Operation {
 96  # The operations author.
 97  author: Person!
 98
 99  # The datetime when this operation was issued.
100  date: Time!
101}
102
103type CreateOperation implements Operation, Authored {
104  author: Person!
105  date: Time!
106
107  title: String!
108  message: String!
109}
110
111type SetTitleOperation implements Operation, Authored {
112  author: Person!
113  date: Time!
114
115  title: String!
116}
117
118type AddCommentOperation implements Operation, Authored {
119  author: Person!
120  date: Time!
121
122  message: String!
123}
124
125type SetStatusOperation implements Operation, Authored {
126  author: Person!
127  date: Time!
128
129  status: Status!
130}
131
132type LabelChangeOperation implements Operation, Authored {
133  author: Person!
134  date: Time!
135
136  added: [Label]!
137  removed: [Label]!
138}
139
140union OperationUnion =
141    CreateOperation
142  | SetTitleOperation
143  | AddCommentOperation
144  | SetStatusOperation
145  | LabelChangeOperation
146
147# The connection type for Label.
148type BugConnection {
149  # A list of edges.
150  edges: [BugEdge]!
151
152  # A list of nodes.
153  nodes: [Bug]!
154
155  # Information to aid in pagination.
156  pageInfo: PageInfo!
157
158  # Identifies the total count of items in the connection.
159  totalCount: Int!
160}
161
162# An edge in a connection.
163type BugEdge {
164  # A cursor for use in pagination.
165  cursor: String!
166
167  # The item at the end of the edge.
168  node: Bug
169}
170
171type Bug implements Authored, Commentable {
172  id: String!
173  humanId: String!
174  title: String!
175  status: Status!
176
177  # A list of labels associated with the repository.
178  labels: [Label]!
179
180  comments(
181    # Returns the elements in the list that come after the specified cursor.
182    after: String
183
184    # Returns the elements in the list that come before the specified cursor.
185    before: String
186
187    # Returns the first _n_ elements from the list.
188    first: Int
189
190    # Returns the last _n_ elements from the list.
191    last: Int
192
193    # If provided, searches comments by name and description.
194    query: String
195  ): CommentConnection!
196
197  operations(
198    # Returns the elements in the list that come after the specified cursor.
199    after: String
200
201    # Returns the elements in the list that come before the specified cursor.
202    before: String
203
204    # Returns the first _n_ elements from the list.
205    first: Int
206
207    # Returns the last _n_ elements from the list.
208    last: Int
209
210    # If provided, searches operations by name and description.
211    query: String
212  ): OperationConnection!
213}
214
215type RootQuery {
216  allBugs(
217    # Returns the elements in the list that come after the specified cursor.
218    after: String
219
220    # Returns the elements in the list that come before the specified cursor.
221    before: String
222
223    # Returns the first _n_ elements from the list.
224    first: Int
225
226    # Returns the last _n_ elements from the list.
227    last: Int
228
229    # If provided, searches labels by name and description.
230    query: String
231  ): BugConnection!
232  bug(id: String!): Bug
233}