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  hash: Hash!
 79}
 80
 81"""An operation applied to a bug."""
 82interface Operation {
 83  """The operations author."""
 84  author: Person!
 85  """The datetime when this operation was issued."""
 86  date: Time!
 87}
 88
 89type CreateOperation implements Operation & Authored {
 90  author: Person!
 91  date: Time!
 92
 93  title: String!
 94  message: String!
 95  files: [Hash!]!
 96}
 97
 98type SetTitleOperation implements Operation & Authored & TimelineItem {
 99  hash: Hash!
100  author: Person!
101  date: Time!
102
103  title: String!
104  was: String!
105}
106
107type AddCommentOperation implements Operation & Authored {
108  author: Person!
109  date: Time!
110
111  message: String!
112  files: [Hash!]!
113}
114
115type SetStatusOperation implements Operation & Authored & TimelineItem {
116  hash: Hash!
117  author: Person!
118  date: Time!
119
120  status: Status!
121}
122
123type LabelChangeOperation implements Operation & Authored & TimelineItem {
124  hash: Hash!
125  author: Person!
126  date: Time!
127
128  added: [Label!]!
129  removed: [Label!]!
130}
131
132type TimelineItemConnection {
133  edges: [TimelineItemEdge!]!
134  nodes: [TimelineItem!]!
135  pageInfo: PageInfo!
136  totalCount: Int!
137}
138
139type TimelineItemEdge {
140  cursor: String!
141  node: TimelineItem!
142}
143
144type CommentHistoryStep {
145  message: String!
146  date: Time!
147}
148
149type CreateTimelineItem implements TimelineItem {
150  hash: Hash!
151  author: Person!
152  message: String!
153  files: [Hash!]!
154  createdAt: Time!
155  lastEdit: Time!
156  edited: Boolean!
157  history: [CommentHistoryStep!]!
158}
159
160type CommentTimelineItem implements TimelineItem {
161  hash: Hash!
162  author: Person!
163  message: String!
164  files: [Hash!]!
165  createdAt: Time!
166  lastEdit: Time!
167  edited: Boolean!
168  history: [CommentHistoryStep!]!
169}
170
171"""The connection type for Bug."""
172type BugConnection {
173  """A list of edges."""
174  edges: [BugEdge!]!
175  nodes: [Bug!]!
176  """Information to aid in pagination."""
177  pageInfo: PageInfo!
178  """Identifies the total count of items in the connection."""
179  totalCount: Int!
180}
181
182"""An edge in a connection."""
183type BugEdge {
184  """A cursor for use in pagination."""
185  cursor: String!
186  """The item at the end of the edge."""
187  node: Bug!
188}
189
190type Bug {
191  id: String!
192  humanId: String!
193  status: Status!
194  title: String!
195  labels: [Label!]!
196  author: Person!
197  createdAt: Time!
198  lastEdit: Time!
199
200  comments(
201    """Returns the elements in the list that come after the specified cursor."""
202    after: String
203    """Returns the elements in the list that come before the specified cursor."""
204    before: String
205    """Returns the first _n_ elements from the list."""
206    first: Int
207    """Returns the last _n_ elements from the list."""
208    last: Int
209  ): CommentConnection!
210
211  timeline(
212    """Returns the elements in the list that come after the specified cursor."""
213    after: String
214    """Returns the elements in the list that come before the specified cursor."""
215    before: String
216    """Returns the first _n_ elements from the list."""
217    first: Int
218    """Returns the last _n_ elements from the list."""
219    last: Int
220  ): TimelineItemConnection!
221
222  operations(
223    """Returns the elements in the list that come after the specified cursor."""
224    after: String
225    """Returns the elements in the list that come before the specified cursor."""
226    before: String
227    """Returns the first _n_ elements from the list."""
228    first: Int
229    """Returns the last _n_ elements from the list."""
230    last: Int
231  ): OperationConnection!
232}
233
234type Repository {
235  allBugs(
236    """Returns the elements in the list that come after the specified cursor."""
237    after: String
238    """Returns the elements in the list that come before the specified cursor."""
239    before: String
240    """Returns the first _n_ elements from the list."""
241    first: Int
242    """Returns the last _n_ elements from the list."""
243    last: Int
244    """A query to select and order bugs"""
245    query: String
246  ): BugConnection!
247  bug(prefix: String!): Bug
248}
249
250type Query {
251  defaultRepository: Repository
252  repository(id: String!): Repository
253}
254
255type Mutation {
256  newBug(repoRef: String, title: String!, message: String!, files: [Hash!]): Bug!
257
258  addComment(repoRef: String, prefix: String!, message: String!, files: [Hash!]): Bug!
259  changeLabels(repoRef: String, prefix: String!, added: [String!], removed: [String!]): Bug!
260  open(repoRef: String, prefix: String!): Bug!
261  close(repoRef: String, prefix: String!): Bug!
262  setTitle(repoRef: String, prefix: String!, title: String!): Bug!
263
264  commit(repoRef: String, prefix: String!): Bug!
265}