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 title: String!
137 status: Status!
138
139 # A list of labels associated with the repository.
140 labels: [Label!]!
141
142 comments(
143 # Returns the elements in the list that come after the specified cursor.
144 after: String
145 # Returns the elements in the list that come before the specified cursor.
146 before: String
147 # Returns the first _n_ elements from the list.
148 first: Int
149 # Returns the last _n_ elements from the list.
150 last: Int
151 ): CommentConnection!
152
153 operations(
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 ): OperationConnection!
163}
164
165type Repository {
166 allBugs(
167 # Returns the elements in the list that come after the specified cursor.
168 after: String
169 # Returns the elements in the list that come before the specified cursor.
170 before: String
171 # Returns the first _n_ elements from the list.
172 first: Int
173 # Returns the last _n_ elements from the list.
174 last: Int
175 ): BugConnection!
176 bug(prefix: String!): Bug
177}
178
179type Query {
180 defaultRepository: Repository
181 repository(id: String!): Repository
182}
183
184type Mutation {
185 newBug(repoRef: String, title: String!, message: String!): Bug!
186
187 addComment(repoRef: String, prefix: String!, message: String!): Bug!
188 changeLabels(repoRef: String, prefix: String!, added: [String!], removed: [String!]): Bug!
189 open(repoRef: String, prefix: String!): Bug!
190 close(repoRef: String, prefix: String!): Bug!
191 setTitle(repoRef: String, prefix: String!, title: String!): Bug!
192
193 commit(repoRef: String, prefix: String!): Bug!
194}