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

pullRequestBatches.graphql.ts

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