Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

pullRequestBatches.graphql.ts

422 lines21.4 KB

1// Generated by @effect/graphql-generator from pullRequestBatches.graphql. Do not edit.
2import { GraphQL, GraphQLGroup } from "effect/graphql"
3import * as Schema from "effect/Schema"
4import * as Shared from "../../schema/github.graphql.ts"
5​
6/** A user is an individual's account on GitHub that owns repositories and can make new content. */
7export const User = Schema.Struct({
8 __typename: Schema.Literal("User"),
9 /** The username used to login. */
10 login: Schema.String,
11 /** A URL pointing to the user's public avatar. */
12 avatarUrl: Shared.URI,
13 /** The user's public profile name. */
14 name: Schema.NullOr(Schema.String)
15})
16export interface User extends Schema.Struct.Type<typeof User.fields> {}
17​
18/** Represents an object which can take actions on GitHub. Typically a User or Bot. */
19export const ActorOther = Schema.Struct({
20 __typename: GraphQL.otherTypename<Shared.Typename.Actor>()(["User"]),
21 /** The username of the actor. */
22 login: Schema.String,
23 /** A URL pointing to the actor's public avatar. */
24 avatarUrl: Shared.URI
25})
26export interface ActorOther extends Schema.Struct.Type<typeof ActorOther.fields> {}
27​
28/** Represents an object which can take actions on GitHub. Typically a User or Bot. */
29export const Actor = Schema.Struct({
30 __typename: GraphQL.otherTypename<Shared.Typename.Actor>()([]),
31 /** The username of the actor. */
32 login: Schema.String
33})
34export interface Actor extends Schema.Struct.Type<typeof Actor.fields> {}
35​
36/** A review object for a given pull request. */
37export const LatestReviewsNodesPullRequestReview = Schema.Struct({
38 /** Identifies the current state of the pull request review. */
39 state: GraphQL.enumLiterals(Shared.PullRequestReviewState.literals),
40 /** Returns whether or not a comment has been minimized. */
41 isMinimized: Schema.Boolean,
42 /** The actor who authored the comment. */
43 author: Schema.NullOr(Actor)
44})
45export interface LatestReviewsNodesPullRequestReview extends Schema.Struct.Type<typeof LatestReviewsNodesPullRequestReview.fields> {}
46​
47/** The connection type for PullRequestReview. */
48export const LatestReviewsPullRequestReviewConnection = Schema.Struct({
49 /** A list of nodes. */
50 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(LatestReviewsNodesPullRequestReview)))
51})
52export interface LatestReviewsPullRequestReviewConnection extends Schema.Struct.Type<typeof LatestReviewsPullRequestReviewConnection.fields> {}
53​
54/** Represents the rollup for both the check runs and status for a commit. */
55export const PullRequestSummaryRepositoryPullRequestCommitsNodesCommitStatusCheckRollupStatusCheckRollup = Schema.Struct({
56 /** The combined status for the commit. */
57 state: GraphQL.enumLiterals(Shared.StatusState.literals)
58})
59export interface PullRequestSummaryRepositoryPullRequestCommitsNodesCommitStatusCheckRollupStatusCheckRollup extends Schema.Struct.Type<typeof PullRequestSummaryRepositoryPullRequestCommitsNodesCommitStatusCheckRollupStatusCheckRollup.fields> {}
60​
61/** Represents a Git commit. */
62export const PullRequestSummaryRepositoryPullRequestCommitsNodesCommitCommit = Schema.Struct({
63 /** Check and Status rollup information for this commit. */
64 statusCheckRollup: Schema.NullOr(PullRequestSummaryRepositoryPullRequestCommitsNodesCommitStatusCheckRollupStatusCheckRollup)
65})
66export interface PullRequestSummaryRepositoryPullRequestCommitsNodesCommitCommit extends Schema.Struct.Type<typeof PullRequestSummaryRepositoryPullRequestCommitsNodesCommitCommit.fields> {}
67​
68/** Represents a Git commit part of a pull request. */
69export const PullRequestSummaryRepositoryPullRequestCommitsNodesPullRequestCommit = Schema.Struct({
70 /** The Git commit object */
71 commit: PullRequestSummaryRepositoryPullRequestCommitsNodesCommitCommit
72})
73export interface PullRequestSummaryRepositoryPullRequestCommitsNodesPullRequestCommit extends Schema.Struct.Type<typeof PullRequestSummaryRepositoryPullRequestCommitsNodesPullRequestCommit.fields> {}
74​
75/** The connection type for PullRequestCommit. */
76export const PullRequestSummaryRepositoryPullRequestCommitsPullRequestCommitConnection = Schema.Struct({
77 /** A list of nodes. */
78 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(PullRequestSummaryRepositoryPullRequestCommitsNodesPullRequestCommit)))
79})
80export interface PullRequestSummaryRepositoryPullRequestCommitsPullRequestCommitConnection extends Schema.Struct.Type<typeof PullRequestSummaryRepositoryPullRequestCommitsPullRequestCommitConnection.fields> {}
81​
82/** A stack of PullRequests */
83export const PullRequestStack = Schema.Struct({
84 /** A number uniquely identifying the stack within its repository */
85 number: Shared.Int,
86 /** The total number of pull requests in the stack */
87 size: Shared.Int,
88 /** The branch that the stack's pull requests target */
89 baseRefName: Schema.String
90})
91export interface PullRequestStack extends Schema.Struct.Type<typeof PullRequestStack.fields> {}
92​
93/** A member of a PullRequestStack */
94export const PullRequestStackEntry = Schema.Struct({
95 /** This entry's position in the stack, where 1 is the closest to the base branch, 2 is stacked on top of 1, etc. */
96 position: Shared.Int
97})
98export interface PullRequestStackEntry extends Schema.Struct.Type<typeof PullRequestStackEntry.fields> {}
99​
100/** A repository pull request. */
101export const PullRequestSummaryRepositoryPullRequestPullRequest = Schema.Struct({
102 /** Identifies the pull request number. */
103 number: Shared.Int,
104 /** Identifies the pull request title. */
105 title: Schema.String,
106 /** The HTTP URL for this pull request. */
107 url: Shared.URI,
108 /** Identifies the state of the pull request. */
109 state: GraphQL.enumLiterals(Shared.PullRequestState.literals),
110 /** Identifies if the pull request is a draft. */
111 isDraft: Schema.Boolean,
112 /** Whether or not the pull request can be merged based on the existence of merge conflicts. */
113 mergeable: GraphQL.enumLiterals(Shared.MergeableState.literals),
114 /** The current status of this pull request with respect to code review. */
115 reviewDecision: Schema.NullOr(GraphQL.enumLiterals(Shared.PullRequestReviewDecision.literals)),
116 /** The number of additions in this pull request. */
117 additions: Shared.Int,
118 /** The number of deletions in this pull request. */
119 deletions: Shared.Int,
120 /** The number of changed files in this pull request. */
121 changedFiles: Shared.Int,
122 /** Identifies the date and time when the object was last updated. */
123 updatedAt: Shared.DateTime,
124 /** The date and time that the pull request was merged. */
125 mergedAt: Schema.NullOr(Shared.DateTime),
126 /** Identifies the date and time when the object was closed. */
127 closedAt: Schema.NullOr(Shared.DateTime),
128 /** Identifies the name of the head Ref associated with the pull request, even if the ref has been deleted. */
129 headRefName: Schema.String,
130 /** Identifies the name of the base Ref associated with the pull request, even if the ref has been deleted. */
131 baseRefName: Schema.String,
132 /** The actor who authored the comment. */
133 author: Schema.NullOr(Schema.Union([
134 User,
135 ActorOther
136 ])),
137 /** A list of latest reviews per user associated with the pull request that are not also pending review. */
138 latestReviews: Schema.NullOr(LatestReviewsPullRequestReviewConnection),
139 /** A list of commits present in this pull request's head branch not present in the base branch. */
140 commits: PullRequestSummaryRepositoryPullRequestCommitsPullRequestCommitConnection,
141 /** The stack this Pull Request belongs to, or null if it is not part of a stack */
142 stack: Schema.optionalKey(Schema.NullOr(PullRequestStack)),
143 /** The stack entry for this Pull Request, or null if it is not part of a stack */
144 stackEntry: Schema.optionalKey(Schema.NullOr(PullRequestStackEntry))
145})
146export interface PullRequestSummaryRepositoryPullRequestPullRequest extends Schema.Struct.Type<typeof PullRequestSummaryRepositoryPullRequestPullRequest.fields> {}
147​
148/** A repository contains the content for a project. */
149export const PullRequestSummaryRepositoryRepository = Schema.Struct({
150 /** Returns a single pull request from the current repository by number. */
151 pullRequest: Schema.NullOr(PullRequestSummaryRepositoryPullRequestPullRequest)
152})
153export interface PullRequestSummaryRepositoryRepository extends Schema.Struct.Type<typeof PullRequestSummaryRepositoryRepository.fields> {}
154​
155/** `query PullRequestSummary` */
156export const PullRequestSummary = GraphQL.query("PullRequestSummary", {
157 document: {
158 variables: [
159 { name: "owner", body: "String!" },
160 { name: "name", body: "String!" },
161 { name: "number", body: "Int!" },
162 { name: "stacks", body: "Boolean!" }
163 ],
164 selections: [
165 { name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequest(number:$", "number", "){number title url state isDraft mergeable reviewDecision additions deletions changedFiles updatedAt mergedAt closedAt headRefName baseRefName author{__typename login avatarUrl...on User{name}}latestReviews(first:20){nodes{state isMinimized author{__typename login}}}commits(last:1){nodes{commit{statusCheckRollup{state}}}}stack@include(if:$", "stacks", "){number size baseRefName}stackEntry@include(if:$", "stacks", "){position}}}"] }
166 ],
167 fragments: []
168 },
169 variables: {
170 owner: Schema.String,
171 name: Schema.String,
172 number: Shared.Int,
173 stacks: Schema.Boolean
174 },
175 result: Schema.Struct({
176 /** Lookup a given repository by the owner and repository name. */
177 repository: Schema.NullOr(PullRequestSummaryRepositoryRepository)
178 })
179})
180export declare namespace PullRequestSummary {
181 export type Variables = typeof PullRequestSummary.variables.Type
182 export type Result = typeof PullRequestSummary.result.Type
184​
185/** A repository pull request. */
186export const PullRequestStatsRepositoryPullRequestPullRequest = Schema.Struct({
187 /** The number of additions in this pull request. */
188 additions: Shared.Int,
189 /** The number of deletions in this pull request. */
190 deletions: Shared.Int
191})
192export interface PullRequestStatsRepositoryPullRequestPullRequest extends Schema.Struct.Type<typeof PullRequestStatsRepositoryPullRequestPullRequest.fields> {}
193​
194/** A repository contains the content for a project. */
195export const PullRequestStatsRepositoryRepository = Schema.Struct({
196 /** Returns a single pull request from the current repository by number. */
197 pullRequest: Schema.NullOr(PullRequestStatsRepositoryPullRequestPullRequest)
198})
199export interface PullRequestStatsRepositoryRepository extends Schema.Struct.Type<typeof PullRequestStatsRepositoryRepository.fields> {}
200​
201/** `query PullRequestStats` */
202export const PullRequestStats = GraphQL.query("PullRequestStats", {
203 document: {
204 variables: [
205 { name: "owner", body: "String!" },
206 { name: "name", body: "String!" },
207 { name: "number", body: "Int!" }
208 ],
209 selections: [
210 { name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequest(number:$", "number", "){additions deletions}}"] }
211 ],
212 fragments: []
213 },
214 variables: {
215 owner: Schema.String,
216 name: Schema.String,
217 number: Shared.Int
218 },
219 result: Schema.Struct({
220 /** Lookup a given repository by the owner and repository name. */
221 repository: Schema.NullOr(PullRequestStatsRepositoryRepository)
222 })
223})
224export declare namespace PullRequestStats {
225 export type Variables = typeof PullRequestStats.variables.Type
226 export type Result = typeof PullRequestStats.result.Type
228​
229/** A repository pull request. */
230export const PullRequestStackMembershipRepositoryPullRequestPullRequest = Schema.Struct({
231 /** The stack this Pull Request belongs to, or null if it is not part of a stack */
232 stack: Schema.NullOr(PullRequestStack),
233 /** The stack entry for this Pull Request, or null if it is not part of a stack */
234 stackEntry: Schema.NullOr(PullRequestStackEntry)
235})
236export interface PullRequestStackMembershipRepositoryPullRequestPullRequest extends Schema.Struct.Type<typeof PullRequestStackMembershipRepositoryPullRequestPullRequest.fields> {}
237​
238/** A repository contains the content for a project. */
239export const PullRequestStackMembershipRepositoryRepository = Schema.Struct({
240 /** Returns a single pull request from the current repository by number. */
241 pullRequest: Schema.NullOr(PullRequestStackMembershipRepositoryPullRequestPullRequest)
242})
243export interface PullRequestStackMembershipRepositoryRepository extends Schema.Struct.Type<typeof PullRequestStackMembershipRepositoryRepository.fields> {}
244​
245/** `query PullRequestStackMembership` */
246export const PullRequestStackMembership = GraphQL.query("PullRequestStackMembership", {
247 document: {
248 variables: [
249 { name: "owner", body: "String!" },
250 { name: "name", body: "String!" },
251 { name: "number", body: "Int!" }
252 ],
253 selections: [
254 { name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequest(number:$", "number", "){stack{number size baseRefName}stackEntry{position}}}"] }
255 ],
256 fragments: []
257 },
258 variables: {
259 owner: Schema.String,
260 name: Schema.String,
261 number: Shared.Int
262 },
263 result: Schema.Struct({
264 /** Lookup a given repository by the owner and repository name. */
265 repository: Schema.NullOr(PullRequestStackMembershipRepositoryRepository)
266 })
267})
268export declare namespace PullRequestStackMembership {
269 export type Variables = typeof PullRequestStackMembership.variables.Type
270 export type Result = typeof PullRequestStackMembership.result.Type
272​
273/** Represents a comment on an Issue. */
274export const IssueComment = Schema.Struct({
275 /** The moment the editor made the last edit */
276 lastEditedAt: Schema.NullOr(Shared.DateTime)
277})
278export interface IssueComment extends Schema.Struct.Type<typeof IssueComment.fields> {}
279​
280/** The connection type for IssueComment. */
281export const IssueCommentConnection = Schema.Struct({
282 /** Identifies the total count of items in the connection. */
283 totalCount: Shared.Int,
284 /** A list of nodes. */
285 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(IssueComment)))
286})
287export interface IssueCommentConnection extends Schema.Struct.Type<typeof IssueCommentConnection.fields> {}
288​
289/** A review object for a given pull request. */
290export const ReviewsNodesPullRequestReview = Schema.Struct({
291 /** The moment the editor made the last edit */
292 lastEditedAt: Schema.NullOr(Shared.DateTime)
293})
294export interface ReviewsNodesPullRequestReview extends Schema.Struct.Type<typeof ReviewsNodesPullRequestReview.fields> {}
295​
296/** The connection type for PullRequestReview. */
297export const ReviewsPullRequestReviewConnection = Schema.Struct({
298 /** Identifies the total count of items in the connection. */
299 totalCount: Shared.Int,
300 /** A list of nodes. */
301 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(ReviewsNodesPullRequestReview)))
302})
303export interface ReviewsPullRequestReviewConnection extends Schema.Struct.Type<typeof ReviewsPullRequestReviewConnection.fields> {}
304​
305/** Review comment threads for a pull request review. */
306export const PullRequestReviewThreadConnection = Schema.Struct({
307 /** Identifies the total count of items in the connection. */
308 totalCount: Shared.Int
309})
310export interface PullRequestReviewThreadConnection extends Schema.Struct.Type<typeof PullRequestReviewThreadConnection.fields> {}
311​
312/** Represents a count of the state of a check run. */
313export const CheckRunStateCount = Schema.Struct({
314 /** The state of a check run. */
315 state: GraphQL.enumLiterals(Shared.CheckRunState.literals),
316 /** The number of check runs with this state. */
317 count: Shared.Int
318})
319export interface CheckRunStateCount extends Schema.Struct.Type<typeof CheckRunStateCount.fields> {}
320​
321/** Represents a count of the state of a status context. */
322export const StatusContextStateCount = Schema.Struct({
323 /** The state of a status context. */
324 state: GraphQL.enumLiterals(Shared.StatusState.literals),
325 /** The number of statuses with this state. */
326 count: Shared.Int
327})
328export interface StatusContextStateCount extends Schema.Struct.Type<typeof StatusContextStateCount.fields> {}
329​
330/** The connection type for StatusCheckRollupContext. */
331export const StatusCheckRollupContextConnection = Schema.Struct({
332 /** Counts of check runs by state. */
333 checkRunCountsByState: Schema.NullOr(Schema.Array(CheckRunStateCount)),
334 /** Counts of status contexts by state. */
335 statusContextCountsByState: Schema.NullOr(Schema.Array(StatusContextStateCount))
336})
337export interface StatusCheckRollupContextConnection extends Schema.Struct.Type<typeof StatusCheckRollupContextConnection.fields> {}
338​
339/** Represents the rollup for both the check runs and status for a commit. */
340export const PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesCommitStatusCheckRollupStatusCheckRollup = Schema.Struct({
341 /** A list of status contexts and check runs for this commit. */
342 contexts: StatusCheckRollupContextConnection
343})
344export interface PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesCommitStatusCheckRollupStatusCheckRollup extends Schema.Struct.Type<typeof PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesCommitStatusCheckRollupStatusCheckRollup.fields> {}
345​
346/** Represents a Git commit. */
347export const PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesCommitCommit = Schema.Struct({
348 /** Check and Status rollup information for this commit. */
349 statusCheckRollup: Schema.NullOr(PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesCommitStatusCheckRollupStatusCheckRollup)
350})
351export interface PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesCommitCommit extends Schema.Struct.Type<typeof PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesCommitCommit.fields> {}
352​
353/** Represents a Git commit part of a pull request. */
354export const PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesPullRequestCommit = Schema.Struct({
355 /** The Git commit object */
356 commit: PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesCommitCommit
357})
358export interface PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesPullRequestCommit extends Schema.Struct.Type<typeof PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesPullRequestCommit.fields> {}
359​
360/** The connection type for PullRequestCommit. */
361export const PullRequestWatchFingerprintRepositoryPullRequestCommitsPullRequestCommitConnection = Schema.Struct({
362 /** A list of nodes. */
363 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(PullRequestWatchFingerprintRepositoryPullRequestCommitsNodesPullRequestCommit)))
364})
365export interface PullRequestWatchFingerprintRepositoryPullRequestCommitsPullRequestCommitConnection extends Schema.Struct.Type<typeof PullRequestWatchFingerprintRepositoryPullRequestCommitsPullRequestCommitConnection.fields> {}
366​
367/** A repository pull request. */
368export const PullRequestWatchFingerprintRepositoryPullRequestPullRequest = Schema.Struct({
369 /** Identifies the state of the pull request. */
370 state: GraphQL.enumLiterals(Shared.PullRequestState.literals),
371 /** Whether or not the pull request can be merged based on the existence of merge conflicts. */
372 mergeable: GraphQL.enumLiterals(Shared.MergeableState.literals),
373 /** Identifies the oid of the head ref associated with the pull request, even if the ref has been deleted. */
374 headRefOid: Shared.GitObjectID,
375 /** A list of comments associated with the pull request. */
376 comments: IssueCommentConnection,
377 /** A list of reviews associated with the pull request. */
378 reviews: Schema.NullOr(ReviewsPullRequestReviewConnection),
379 /** The list of all review threads for this pull request. */
380 reviewThreads: PullRequestReviewThreadConnection,
381 /** A list of commits present in this pull request's head branch not present in the base branch. */
382 commits: PullRequestWatchFingerprintRepositoryPullRequestCommitsPullRequestCommitConnection
383})
384export interface PullRequestWatchFingerprintRepositoryPullRequestPullRequest extends Schema.Struct.Type<typeof PullRequestWatchFingerprintRepositoryPullRequestPullRequest.fields> {}
385​
386/** A repository contains the content for a project. */
387export const PullRequestWatchFingerprintRepositoryRepository = Schema.Struct({
388 /** Returns a single pull request from the current repository by number. */
389 pullRequest: Schema.NullOr(PullRequestWatchFingerprintRepositoryPullRequestPullRequest)
390})
391export interface PullRequestWatchFingerprintRepositoryRepository extends Schema.Struct.Type<typeof PullRequestWatchFingerprintRepositoryRepository.fields> {}
392​
393/** `query PullRequestWatchFingerprint` */
394export const PullRequestWatchFingerprint = GraphQL.query("PullRequestWatchFingerprint", {
395 document: {
396 variables: [
397 { name: "owner", body: "String!" },
398 { name: "name", body: "String!" },
399 { name: "number", body: "Int!" }
400 ],
401 selections: [
402 { name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequest(number:$", "number", "){state mergeable headRefOid comments(first:100 orderBy:{field:UPDATED_AT direction:DESC}){totalCount nodes{lastEditedAt}}reviews(last:100){totalCount nodes{lastEditedAt}}reviewThreads{totalCount}commits(last:1){nodes{commit{statusCheckRollup{contexts{checkRunCountsByState{state count}statusContextCountsByState{state count}}}}}}}}"] }
403 ],
404 fragments: []
405 },
406 variables: {
407 owner: Schema.String,
408 name: Schema.String,
409 number: Shared.Int
410 },
411 result: Schema.Struct({
412 /** Lookup a given repository by the owner and repository name. */
413 repository: Schema.NullOr(PullRequestWatchFingerprintRepositoryRepository)
414 })
415})
416export declare namespace PullRequestWatchFingerprint {
417 export type Variables = typeof PullRequestWatchFingerprint.variables.Type
418 export type Result = typeof PullRequestWatchFingerprint.result.Type
420​
421/** Every operation in pullRequestBatches.graphql. */
422export const PullRequestBatchesGraphQLGroup = GraphQLGroup.make(PullRequestSummary, PullRequestStats, PullRequestStackMembership, PullRequestWatchFingerprint)