schema.graphql

  1scalar Time
  2scalar Label
  3scalar Hash
  4
  5"""Information about pagination in a connection."""
  6type PageInfo {
  7  """When paginating forwards, are there more items?"""
  8  hasNextPage: Boolean!
  9  """When paginating backwards, are there more items?"""
 10  hasPreviousPage: Boolean!
 11  """When paginating backwards, the cursor to continue."""
 12  startCursor: String!
 13  """When paginating forwards, the cursor to continue."""
 14  endCursor: String!
 15}
 16
 17"""Represents an person in a git object."""
 18type Person {
 19  """The name of the person, if known."""
 20  name: String
 21
 22  """The email of the person, if known."""
 23  email: String
 24
 25  """The login of the person, if known."""
 26  login: String
 27
 28  """A string containing the either the name of the person, its login or both"""
 29  displayName: String!
 30
 31  """An url to an avatar"""
 32  avatarUrl: String
 33}
 34
 35type CommentConnection {
 36  edges: [CommentEdge!]!
 37  nodes: [Comment!]!
 38  pageInfo: PageInfo!
 39  totalCount: Int!
 40}
 41
 42type CommentEdge {
 43  cursor: String!
 44  node: Comment!
 45}
 46
 47"""Represents a comment on a bug."""
 48type Comment implements Authored {
 49  """The author of this comment."""
 50  author: Person!
 51
 52  """The message of this comment."""
 53  message: String!
 54
 55  """All media's hash referenced in this comment"""
 56  files: [Hash!]!
 57}
 58
 59enum Status {
 60  OPEN
 61  CLOSED
 62}
 63
 64"""An object that has an author."""
 65interface Authored {
 66  """The author of this object."""
 67  author: Person!
 68}
 69
 70type OperationConnection {
 71  edges: [OperationEdge!]!
 72  nodes: [Operation!]!
 73  pageInfo: PageInfo!
 74  totalCount: Int!
 75}
 76
 77type OperationEdge {
 78  cursor: String!
 79  node: Operation!
 80}
 81
 82"""An item in the timeline of events"""
 83interface TimelineItem {
 84  """The hash of the source operation"""
 85  hash: Hash!
 86}
 87
 88"""An operation applied to a bug."""
 89interface Operation {
 90  """The hash of the operation"""
 91  hash: Hash!
 92  """The operations author."""
 93  author: Person!
 94  """The datetime when this operation was issued."""
 95  date: Time!
 96}
 97
 98type CreateOperation implements Operation & Authored {
 99  """The hash of the operation"""
100  hash: Hash!
101  """The author of this object."""
102  author: Person!
103  """The datetime when this operation was issued."""
104  date: Time!
105
106  title: String!
107  message: String!
108  files: [Hash!]!
109}
110
111type SetTitleOperation implements Operation & Authored {
112  """The hash of the operation"""
113  hash: Hash!
114  """The author of this object."""
115  author: Person!
116  """The datetime when this operation was issued."""
117  date: Time!
118
119  title: String!
120  was: String!
121}
122
123type AddCommentOperation implements Operation & Authored {
124  """The hash of the operation"""
125  hash: Hash!
126  """The author of this object."""
127  author: Person!
128  """The datetime when this operation was issued."""
129  date: Time!
130
131  message: String!
132  files: [Hash!]!
133}
134
135type EditCommentOperation implements Operation & Authored {
136  """The hash of the operation"""
137  hash: Hash!
138  """The author of this object."""
139  author: Person!
140  """The datetime when this operation was issued."""
141  date: Time!
142
143  target: Hash!
144  message: String!
145  files: [Hash!]!
146}
147
148type SetStatusOperation implements Operation & Authored {
149  """The hash of the operation"""
150  hash: Hash!
151  """The author of this object."""
152  author: Person!
153  """The datetime when this operation was issued."""
154  date: Time!
155
156  status: Status!
157}
158
159type LabelChangeOperation implements Operation & Authored {
160  """The hash of the operation"""
161  hash: Hash!
162  """The author of this object."""
163  author: Person!
164  """The datetime when this operation was issued."""
165  date: Time!
166
167  added: [Label!]!
168  removed: [Label!]!
169}
170
171type TimelineItemConnection {
172  edges: [TimelineItemEdge!]!
173  nodes: [TimelineItem!]!
174  pageInfo: PageInfo!
175  totalCount: Int!
176}
177
178type TimelineItemEdge {
179  cursor: String!
180  node: TimelineItem!
181}
182
183type CommentHistoryStep {
184  message: String!
185  date: Time!
186}
187
188type CreateTimelineItem implements TimelineItem {
189  """The hash of the source operation"""
190  hash: Hash!
191  author: Person!
192  message: String!
193  files: [Hash!]!
194  createdAt: Time!
195  lastEdit: Time!
196  edited: Boolean!
197  history: [CommentHistoryStep!]!
198}
199
200type AddCommentTimelineItem implements TimelineItem {
201  """The hash of the source operation"""
202  hash: Hash!
203  author: Person!
204  message: String!
205  files: [Hash!]!
206  createdAt: Time!
207  lastEdit: Time!
208  edited: Boolean!
209  history: [CommentHistoryStep!]!
210}
211
212type LabelChangeTimelineItem implements TimelineItem {
213  """The hash of the source operation"""
214  hash: Hash!
215  author: Person!
216  date: Time!
217  added: [Label!]!
218  removed: [Label!]!
219}
220
221type SetStatusTimelineItem implements TimelineItem {
222  """The hash of the source operation"""
223  hash: Hash!
224  author: Person!
225  date: Time!
226  status: Status!
227}
228
229type SetTitleTimelineItem implements TimelineItem {
230  """The hash of the source operation"""
231  hash: Hash!
232  author: Person!
233  date: Time!
234  title: String!
235  was: String!
236}
237
238"""The connection type for Bug."""
239type BugConnection {
240  """A list of edges."""
241  edges: [BugEdge!]!
242  nodes: [Bug!]!
243  """Information to aid in pagination."""
244  pageInfo: PageInfo!
245  """Identifies the total count of items in the connection."""
246  totalCount: Int!
247}
248
249"""An edge in a connection."""
250type BugEdge {
251  """A cursor for use in pagination."""
252  cursor: String!
253  """The item at the end of the edge."""
254  node: Bug!
255}
256
257type Bug {
258  id: String!
259  humanId: String!
260  status: Status!
261  title: String!
262  labels: [Label!]!
263  author: Person!
264  createdAt: Time!
265  lastEdit: Time!
266
267  comments(
268    """Returns the elements in the list that come after the specified cursor."""
269    after: String
270    """Returns the elements in the list that come before the specified cursor."""
271    before: String
272    """Returns the first _n_ elements from the list."""
273    first: Int
274    """Returns the last _n_ elements from the list."""
275    last: Int
276  ): CommentConnection!
277
278  timeline(
279    """Returns the elements in the list that come after the specified cursor."""
280    after: String
281    """Returns the elements in the list that come before the specified cursor."""
282    before: String
283    """Returns the first _n_ elements from the list."""
284    first: Int
285    """Returns the last _n_ elements from the list."""
286    last: Int
287  ): TimelineItemConnection!
288
289  operations(
290    """Returns the elements in the list that come after the specified cursor."""
291    after: String
292    """Returns the elements in the list that come before the specified cursor."""
293    before: String
294    """Returns the first _n_ elements from the list."""
295    first: Int
296    """Returns the last _n_ elements from the list."""
297    last: Int
298  ): OperationConnection!
299}
300
301type Repository {
302  allBugs(
303    """Returns the elements in the list that come after the specified cursor."""
304    after: String
305    """Returns the elements in the list that come before the specified cursor."""
306    before: String
307    """Returns the first _n_ elements from the list."""
308    first: Int
309    """Returns the last _n_ elements from the list."""
310    last: Int
311    """A query to select and order bugs"""
312    query: String
313  ): BugConnection!
314  bug(prefix: String!): Bug
315}
316
317type Query {
318  defaultRepository: Repository
319  repository(id: String!): Repository
320}
321
322type Mutation {
323  newBug(repoRef: String, title: String!, message: String!, files: [Hash!]): Bug!
324
325  addComment(repoRef: String, prefix: String!, message: String!, files: [Hash!]): Bug!
326  changeLabels(repoRef: String, prefix: String!, added: [String!], removed: [String!]): Bug!
327  open(repoRef: String, prefix: String!): Bug!
328  close(repoRef: String, prefix: String!): Bug!
329  setTitle(repoRef: String, prefix: String!, title: String!): Bug!
330
331  commit(repoRef: String, prefix: String!): Bug!
332}