schema.graphql

  1scalar Time
  2scalar Label
  3
  4# Information about pagination in a connection.
  5type PageInfo {
  6  # When paginating forwards, are there more items?
  7  hasNextPage: Boolean!
  8
  9  # When paginating backwards, are there more items?
 10  hasPreviousPage: Boolean!
 11
 12  # When paginating backwards, the cursor to continue.
 13#  startCursor: String
 14
 15  # When paginating forwards, the cursor to continue.
 16#  endCursor: String
 17}
 18
 19input ConnectionInput {
 20  # Returns the elements in the list that come after the specified cursor.
 21  after: String
 22
 23  # Returns the elements in the list that come before the specified cursor.
 24  before: String
 25
 26  # Returns the first _n_ elements from the list.
 27  first: Int
 28
 29  # Returns the last _n_ elements from the list.
 30  last: Int
 31}
 32
 33# Represents an person in a git object.
 34type Person {
 35  # The email of the person.
 36  email: String
 37
 38  # The name of the person.
 39  name: String
 40}
 41
 42
 43type CommentConnection {
 44  edges: [CommentEdge!]!
 45  pageInfo: PageInfo!
 46  totalCount: Int!
 47}
 48
 49type CommentEdge {
 50  cursor: String!
 51  node: Comment!
 52}
 53
 54# Represents a comment on a bug.
 55type Comment implements Authored {
 56  # The author of this comment.
 57  author: Person!
 58
 59  # The message of this comment.
 60  message: String!
 61}
 62
 63enum Status {
 64  OPEN
 65  CLOSED
 66}
 67
 68# An object that has an author.
 69interface Authored {
 70  # The author of this object.
 71  author: Person!
 72}
 73
 74type OperationConnection {
 75  edges: [OperationEdge!]!
 76  pageInfo: PageInfo!
 77  totalCount: Int!
 78}
 79
 80type OperationEdge {
 81  cursor: String!
 82  node: Operation!
 83}
 84
 85# An operation applied to a bug.
 86interface Operation {
 87  # The operations author.
 88  author: Person!
 89
 90  # The datetime when this operation was issued.
 91  date: Time!
 92}
 93
 94type CreateOperation implements Operation, Authored {
 95  author: Person!
 96  date: Time!
 97
 98  title: String!
 99  message: String!
100}
101
102type SetTitleOperation implements Operation, Authored {
103  author: Person!
104  date: Time!
105
106  title: String!
107}
108
109type AddCommentOperation implements Operation, Authored {
110  author: Person!
111  date: Time!
112
113  message: String!
114}
115
116type SetStatusOperation implements Operation, Authored {
117  author: Person!
118  date: Time!
119
120  status: Status!
121}
122
123type LabelChangeOperation implements Operation, Authored {
124  author: Person!
125  date: Time!
126
127  added: [Label!]!
128  removed: [Label!]!
129}
130
131# The connection type for Bug.
132type BugConnection {
133  # A list of edges.
134  edges: [BugEdge!]!
135
136  # Information to aid in pagination.
137  pageInfo: PageInfo!
138
139  # Identifies the total count of items in the connection.
140  totalCount: Int!
141}
142
143# An edge in a connection.
144type BugEdge {
145  # A cursor for use in pagination.
146  cursor: String!
147
148  # The item at the end of the edge.
149  node: Bug!
150}
151
152type Bug {
153  id: String!
154  humanId: String!
155  title: String!
156  status: Status!
157
158  # A list of labels associated with the repository.
159  labels: [Label!]!
160
161  comments(input: ConnectionInput!): CommentConnection!
162
163  operations(input: ConnectionInput!): OperationConnection!
164}
165
166type Repository {
167  allBugs(input: ConnectionInput!): BugConnection!
168  bug(prefix: String!): Bug
169}
170
171type Query {
172  defaultRepository: Repository
173  repository(id: String!): Repository
174}
175
176type Mutation {
177  newBug(repoRef: String, title: String!, message: String!): Bug!
178}