master
1// DO NOT EDIT. This is a generated file. Instead of this file, edit "pulls.graphql".
2
3const PullRequest = `#graphql
4fragment PullRequest on PullRequest {
5 id
6 createdAt
7 url
8 number
9 title
10 body
11 closed
12 merged
13 mergedAt
14 mergedBy {
15 login
16 }
17 labels(first: 10) {
18 totalCount
19 nodes {
20 name
21 }
22 }
23 repository {
24 isPrivate
25 nameWithOwner
26 owner {
27 login
28 }
29 name
30 languages(first: 10, orderBy: {field: SIZE, direction: DESC}) {
31 totalCount
32 nodes {
33 name
34 }
35 }
36 }
37 participants(first: 20) {
38 totalCount
39 nodes {
40 login
41 }
42 }
43 lastCommit: commits(last: 1) {
44 nodes {
45 commit {
46 checkSuites(first: 20) {
47 totalCount
48 nodes {
49 app {
50 name
51 }
52 workflowRun {
53 workflow {
54 name
55 }
56 }
57 lastCheckRun: checkRuns(last: 1) {
58 totalCount
59 nodes {
60 name
61 conclusion
62 status
63 startedAt
64 completedAt
65 }
66 }
67 }
68 }
69 }
70 }
71 }
72 reactionsTotal: reactions {
73 totalCount
74 }
75}`
76
77export type PullRequest = {
78 id: string
79 createdAt: string
80 url: string
81 number: number
82 title: string
83 body: string
84 closed: boolean
85 merged: boolean
86 mergedAt: string | null
87 mergedBy: {
88 login: string
89 } | null
90 labels: {
91 totalCount: number
92 nodes: Array<{
93 name: string
94 }> | null
95 } | null
96 repository: {
97 isPrivate: boolean
98 nameWithOwner: string
99 owner: {
100 login: string
101 }
102 name: string
103 languages: {
104 totalCount: number
105 nodes: Array<{
106 name: string
107 }> | null
108 } | null
109 }
110 participants: {
111 totalCount: number
112 nodes: Array<{
113 login: string
114 }> | null
115 }
116 lastCommit: {
117 nodes: Array<{
118 commit: {
119 checkSuites: {
120 totalCount: number
121 nodes: Array<{
122 app: {
123 name: string
124 } | null
125 workflowRun: {
126 workflow: {
127 name: string
128 }
129 } | null
130 lastCheckRun: {
131 totalCount: number
132 nodes: Array<{
133 name: string
134 conclusion:
135 | 'ACTION_REQUIRED'
136 | 'CANCELLED'
137 | 'FAILURE'
138 | 'NEUTRAL'
139 | 'SKIPPED'
140 | 'STALE'
141 | 'STARTUP_FAILURE'
142 | 'SUCCESS'
143 | 'TIMED_OUT'
144 status:
145 | 'COMPLETED'
146 | 'IN_PROGRESS'
147 | 'PENDING'
148 | 'QUEUED'
149 | 'REQUESTED'
150 | 'WAITING'
151 startedAt: string | null
152 completedAt: string | null
153 }> | null
154 } | null
155 }> | null
156 } | null
157 }
158 }> | null
159 }
160 reactionsTotal: {
161 totalCount: number
162 }
163}
164
165export const PullsQuery = `#graphql
166${PullRequest}
167query PullsQuery($username: String!, $num: Int = 30, $cursor: String) {
168 user(login: $username) {
169 pullRequests(first: $num, after: $cursor) {
170 totalCount
171 nodes {
172 ...PullRequest
173 }
174 pageInfo {
175 hasNextPage
176 endCursor
177 }
178 }
179 }
180 rateLimit {
181 limit
182 cost
183 remaining
184 resetAt
185 }
186}` as string & PullsQuery
187
188export type PullsQuery = (vars: {
189 username: string
190 num?: number | null
191 cursor?: string | null
192}) => {
193 user: {
194 pullRequests: {
195 totalCount: number
196 nodes: Array<{} & PullRequest> | null
197 pageInfo: {
198 hasNextPage: boolean
199 endCursor: string | null
200 }
201 }
202 } | null
203 rateLimit: {
204 limit: number
205 cost: number
206 remaining: number
207 resetAt: string
208 } | null
209}