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 operation applied to a bug."""
 77interface Operation {
 78  """The operations author."""
 79  author: Person!
 80  """The datetime when this operation was issued."""
 81  date: Time!
 82}
 83
 84type CreateOperation implements Operation & Authored {
 85  author: Person!
 86  date: Time!
 87
 88  title: String!
 89  message: String!
 90  files: [Hash!]!
 91}
 92
 93type SetTitleOperation implements Operation & Authored {
 94  author: Person!
 95  date: Time!
 96
 97  title: String!
 98  was: String!
 99}
100
101type AddCommentOperation implements Operation & Authored {
102  author: Person!
103  date: Time!
104
105  message: String!
106  files: [Hash!]!
107}
108
109type SetStatusOperation implements Operation & Authored {
110  author: Person!
111  date: Time!
112
113  status: Status!
114}
115
116type LabelChangeOperation implements Operation & Authored {
117  author: Person!
118  date: Time!
119
120  added: [Label!]!
121  removed: [Label!]!
122}
123
124"""The connection type for Bug."""
125type BugConnection {
126  """A list of edges."""
127  edges: [BugEdge!]!
128  nodes: [Bug!]!
129  """Information to aid in pagination."""
130  pageInfo: PageInfo!
131  """Identifies the total count of items in the connection."""
132  totalCount: Int!
133}
134
135"""An edge in a connection."""
136type BugEdge {
137  """A cursor for use in pagination."""
138  cursor: String!
139  """The item at the end of the edge."""
140  node: Bug!
141}
142
143type Bug {
144  id: String!
145  humanId: String!
146  status: Status!
147  title: String!
148  labels: [Label!]!
149  author: Person!
150  createdAt: Time!
151  lastEdit: Time!
152
153  comments(
154    """Returns the elements in the list that come after the specified cursor."""
155    after: String
156    """Returns the elements in the list that come before the specified cursor."""
157    before: String
158    """Returns the first _n_ elements from the list."""
159    first: Int
160    """Returns the last _n_ elements from the list."""
161    last: Int
162  ): CommentConnection!
163
164  operations(
165    """Returns the elements in the list that come after the specified cursor."""
166    after: String
167    """Returns the elements in the list that come before the specified cursor."""
168    before: String
169    """Returns the first _n_ elements from the list."""
170    first: Int
171    """Returns the last _n_ elements from the list."""
172    last: Int
173  ): OperationConnection!
174}
175
176type Repository {
177  allBugs(
178    """Returns the elements in the list that come after the specified cursor."""
179    after: String
180    """Returns the elements in the list that come before the specified cursor."""
181    before: String
182    """Returns the first _n_ elements from the list."""
183    first: Int
184    """Returns the last _n_ elements from the list."""
185    last: Int
186    """A query to select and order bugs"""
187    query: String
188  ): BugConnection!
189  bug(prefix: String!): Bug
190}
191
192type Query {
193  defaultRepository: Repository
194  repository(id: String!): Repository
195}
196
197type Mutation {
198  newBug(repoRef: String, title: String!, message: String!, files: [Hash!]): Bug!
199
200  addComment(repoRef: String, prefix: String!, message: String!, files: [Hash!]): Bug!
201  changeLabels(repoRef: String, prefix: String!, added: [String!], removed: [String!]): Bug!
202  open(repoRef: String, prefix: String!): Bug!
203  close(repoRef: String, prefix: String!): Bug!
204  setTitle(repoRef: String, prefix: String!, title: String!): Bug!
205
206  commit(repoRef: String, prefix: String!): Bug!
207}