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