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