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