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

pullRequestListings.graphql.ts

348 lines15.6 KB

1// Generated by @effect/graphql-generator from pullRequestListings.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 stack of PullRequests */
7export const PullRequestStack = Schema.Struct({
8 /** A number uniquely identifying the stack within its repository */
9 number: Shared.Int,
10 /** The total number of pull requests in the stack */
11 size: Shared.Int,
12 /** The branch that the stack's pull requests target */
13 baseRefName: Schema.String
14})
15export interface PullRequestStack extends Schema.Struct.Type<typeof PullRequestStack.fields> {}
16​
17/** A member of a PullRequestStack */
18export const PullRequestStackEntry = Schema.Struct({
19 /** This entry's position in the stack, where 1 is the closest to the base branch, 2 is stacked on top of 1, etc. */
20 position: Shared.Int
21})
22export interface PullRequestStackEntry extends Schema.Struct.Type<typeof PullRequestStackEntry.fields> {}
23​
24/** A user is an individual's account on GitHub that owns repositories and can make new content. */
25export const AuthorUser = Schema.Struct({
26 __typename: Schema.Literal("User"),
27 /** The username used to login. */
28 login: Schema.String,
29 /** A URL pointing to the user's public avatar. */
30 avatarUrl: Shared.URI,
31 /** The user's public profile name. */
32 name: Schema.NullOr(Schema.String)
33})
34export interface AuthorUser extends Schema.Struct.Type<typeof AuthorUser.fields> {}
35​
36/** Represents an object which can take actions on GitHub. Typically a User or Bot. */
37export const ActorOther = Schema.Struct({
38 __typename: GraphQL.otherTypename<Shared.Typename.Actor>()(["User"]),
39 /** The username of the actor. */
40 login: Schema.String,
41 /** A URL pointing to the actor's public avatar. */
42 avatarUrl: Shared.URI
43})
44export interface ActorOther extends Schema.Struct.Type<typeof ActorOther.fields> {}
45​
46/** Represents an object which can take actions on GitHub. Typically a User or Bot. */
47export const Actor = Schema.Struct({
48 __typename: GraphQL.otherTypename<Shared.Typename.Actor>()([]),
49 /** The username of the actor. */
50 login: Schema.String
51})
52export interface Actor extends Schema.Struct.Type<typeof Actor.fields> {}
53​
54/** A review object for a given pull request. */
55export const PullRequestReview = Schema.Struct({
56 /** Identifies the current state of the pull request review. */
57 state: GraphQL.enumLiterals(Shared.PullRequestReviewState.literals),
58 /** Returns whether or not a comment has been minimized. */
59 isMinimized: Schema.Boolean,
60 /** The actor who authored the comment. */
61 author: Schema.NullOr(Actor)
62})
63export interface PullRequestReview extends Schema.Struct.Type<typeof PullRequestReview.fields> {}
64​
65/** The connection type for PullRequestReview. */
66export const PullRequestReviewConnection = Schema.Struct({
67 /** A list of nodes. */
68 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(PullRequestReview)))
69})
70export interface PullRequestReviewConnection extends Schema.Struct.Type<typeof PullRequestReviewConnection.fields> {}
71​
72/** A repository contains the content for a project. */
73export const PullRequestRowRepositoryRepository = Schema.Struct({
74 /** The repository's name with owner. */
75 nameWithOwner: Schema.String
76})
77export interface PullRequestRowRepositoryRepository extends Schema.Struct.Type<typeof PullRequestRowRepositoryRepository.fields> {}
78​
79/** A user is an individual's account on GitHub that owns repositories and can make new content. */
80export const RequestedReviewerUser = Schema.Struct({
81 __typename: Schema.Literal("User"),
82 /** The username used to login. */
83 login: Schema.String
84})
85export interface RequestedReviewerUser extends Schema.Struct.Type<typeof RequestedReviewerUser.fields> {}
86​
87/** A team of users in an organization. */
88export const Team = Schema.Struct({
89 __typename: Schema.Literal("Team"),
90 /** The slug corresponding to the team. */
91 slug: Schema.String
92})
93export interface Team extends Schema.Struct.Type<typeof Team.fields> {}
94​
95/** Types that can be requested reviewers. */
96export const RequestedReviewerOther = Schema.Struct({
97 __typename: GraphQL.otherTypename<Shared.Typename.RequestedReviewer>()(["User", "Team"])
98})
99export interface RequestedReviewerOther extends Schema.Struct.Type<typeof RequestedReviewerOther.fields> {}
100​
101/** A request for a user to review a pull request. */
102export const ReviewRequest = Schema.Struct({
103 /** The reviewer that is requested. */
104 requestedReviewer: Schema.NullOr(Schema.Union([
105 RequestedReviewerUser,
106 Team,
107 RequestedReviewerOther
108 ]))
109})
110export interface ReviewRequest extends Schema.Struct.Type<typeof ReviewRequest.fields> {}
111​
112/** The connection type for ReviewRequest. */
113export const ReviewRequestConnection = Schema.Struct({
114 /** A list of nodes. */
115 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(ReviewRequest)))
116})
117export interface ReviewRequestConnection extends Schema.Struct.Type<typeof ReviewRequestConnection.fields> {}
118​
119/** A label for categorizing Issues, Pull Requests, Milestones, or Discussions with a given Repository. */
120export const Label = Schema.Struct({
121 /** Identifies the label name. */
122 name: Schema.String,
123 /** Identifies the label color. */
124 color: Schema.String,
125 /** A brief description of this label. */
126 description: Schema.NullOr(Schema.String)
127})
128export interface Label extends Schema.Struct.Type<typeof Label.fields> {}
129​
130/** The connection type for Label. */
131export const LabelConnection = Schema.Struct({
132 /** A list of nodes. */
133 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(Label)))
134})
135export interface LabelConnection extends Schema.Struct.Type<typeof LabelConnection.fields> {}
136​
137/** Represents the rollup for both the check runs and status for a commit. */
138export const StatusCheckRollup = Schema.Struct({
139 /** The combined status for the commit. */
140 state: GraphQL.enumLiterals(Shared.StatusState.literals)
141})
142export interface StatusCheckRollup extends Schema.Struct.Type<typeof StatusCheckRollup.fields> {}
143​
144/** Represents a Git commit. */
145export const Commit = Schema.Struct({
146 /** Check and Status rollup information for this commit. */
147 statusCheckRollup: Schema.NullOr(StatusCheckRollup)
148})
149export interface Commit extends Schema.Struct.Type<typeof Commit.fields> {}
150​
151/** Represents a Git commit part of a pull request. */
152export const PullRequestCommit = Schema.Struct({
153 /** The Git commit object */
154 commit: Commit
155})
156export interface PullRequestCommit extends Schema.Struct.Type<typeof PullRequestCommit.fields> {}
157​
158/** The connection type for PullRequestCommit. */
159export const PullRequestCommitConnection = Schema.Struct({
160 /** A list of nodes. */
161 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(PullRequestCommit)))
162})
163export interface PullRequestCommitConnection extends Schema.Struct.Type<typeof PullRequestCommitConnection.fields> {}
164​
165/**
166 * `fragment PullRequestRow on PullRequest`
167 *
168 * A repository pull request.
169 */
170export const PullRequestRow = Schema.Struct({
171 /** The stack this Pull Request belongs to, or null if it is not part of a stack */
172 stack: Schema.optionalKey(Schema.NullOr(PullRequestStack)),
173 /** The stack entry for this Pull Request, or null if it is not part of a stack */
174 stackEntry: Schema.optionalKey(Schema.NullOr(PullRequestStackEntry)),
175 /** Identifies the pull request number. */
176 number: Shared.Int,
177 /** Identifies the pull request title. */
178 title: Schema.String,
179 /** The HTTP URL for this pull request. */
180 url: Shared.URI,
181 /** The actor who authored the comment. */
182 author: Schema.NullOr(Schema.Union([
183 AuthorUser,
184 ActorOther
185 ])),
186 /** Identifies the name of the head Ref associated with the pull request, even if the ref has been deleted. */
187 headRefName: Schema.String,
188 /** Identifies the name of the base Ref associated with the pull request, even if the ref has been deleted. */
189 baseRefName: Schema.String,
190 /** Identifies the state of the pull request. */
191 state: GraphQL.enumLiterals(Shared.PullRequestState.literals),
192 /** Identifies if the pull request is a draft. */
193 isDraft: Schema.Boolean,
194 /** Whether or not the pull request can be merged based on the existence of merge conflicts. */
195 mergeable: GraphQL.enumLiterals(Shared.MergeableState.literals),
196 /** The current status of this pull request with respect to code review. */
197 reviewDecision: Schema.NullOr(GraphQL.enumLiterals(Shared.PullRequestReviewDecision.literals)),
198 /** A list of latest reviews per user associated with the pull request that are not also pending review. */
199 latestReviews: Schema.NullOr(PullRequestReviewConnection),
200 /** The number of additions in this pull request. */
201 additions: Schema.optionalKey(Shared.Int),
202 /** The number of deletions in this pull request. */
203 deletions: Schema.optionalKey(Shared.Int),
204 /** Identifies the date and time when the object was created. */
205 createdAt: Shared.DateTime,
206 /** Identifies the date and time when the object was last updated. */
207 updatedAt: Shared.DateTime,
208 /** The date and time that the pull request was merged. */
209 mergedAt: Schema.NullOr(Shared.DateTime),
210 /** The repository associated with this node. */
211 repository: PullRequestRowRepositoryRepository,
212 /** A list of review requests associated with the pull request. */
213 reviewRequests: Schema.NullOr(ReviewRequestConnection),
214 /** A list of labels associated with the object. */
215 labels: Schema.NullOr(LabelConnection),
216 /** A list of commits present in this pull request's head branch not present in the base branch. */
217 commits: PullRequestCommitConnection
218})
219export interface PullRequestRow extends Schema.Struct.Type<typeof PullRequestRow.fields> {}
220​
221/** Information about pagination in a connection. */
222export const PageInfo = Schema.Struct({
223 /** When paginating forwards, are there more items? */
224 hasNextPage: Schema.Boolean,
225 /** When paginating forwards, the cursor to continue. */
226 endCursor: Schema.NullOr(Schema.String)
227})
228export interface PageInfo extends Schema.Struct.Type<typeof PageInfo.fields> {}
229​
230/** A repository pull request. */
231export const PullRequest = Schema.Struct({
232 __typename: Schema.Literal("PullRequest"),
233 ...PullRequestRow.fields
234})
235export interface PullRequest extends Schema.Struct.Type<typeof PullRequest.fields> {}
236​
237/** The results of a search. */
238export const SearchResultItemOther = Schema.Struct({
239 __typename: GraphQL.otherTypename<Shared.Typename.SearchResultItem>()(["PullRequest"])
240})
241export interface SearchResultItemOther extends Schema.Struct.Type<typeof SearchResultItemOther.fields> {}
242​
243/**
244 * A list of results that matched against a search query. Regardless of the number
245 * of matches, a maximum of 1,000 results will be available across all types,
246 * potentially split across many pages.
247 */
248export const SearchResultItemConnection = Schema.Struct({
249 /** Information to aid in pagination. */
250 pageInfo: PageInfo,
251 /** A list of nodes. */
252 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(Schema.Union([
253 PullRequest,
254 SearchResultItemOther
255 ]))))
256})
257export interface SearchResultItemConnection extends Schema.Struct.Type<typeof SearchResultItemConnection.fields> {}
258​
259/** `query PullRequestSearch` */
260export const PullRequestSearch = GraphQL.query("PullRequestSearch", {
261 document: {
262 variables: [
263 { name: "q", body: "String!" },
264 { name: "first", body: "Int!" },
265 { name: "after", body: "String" },
266 { name: "stacks", body: "Boolean!" },
267 { name: "stats", body: "Boolean!" }
268 ],
269 selections: [
270 { name: "search", body: ["(query:$", "q", " type:ISSUE first:$", "first", " after:$", "after", "){pageInfo{hasNextPage endCursor}nodes{__typename...", "PullRequestRow", "}}"] }
271 ],
272 fragments: [
273 { name: "PullRequestRow", body: ["on PullRequest{stack@include(if:$", "stacks", "){number size baseRefName}stackEntry@include(if:$", "stacks", "){position}number title url author{__typename login avatarUrl...on User{name}}headRefName baseRefName state isDraft mergeable reviewDecision latestReviews(first:20){nodes{state isMinimized author{__typename login}}}additions@include(if:$", "stats", ")deletions@include(if:$", "stats", ")createdAt updatedAt mergedAt repository{nameWithOwner}reviewRequests(first:20){nodes{requestedReviewer{__typename...on User{login}...on Team{slug}}}}labels(first:20){nodes{name color description}}commits(last:1){nodes{commit{statusCheckRollup{state}}}}}"] }
274 ]
275 },
276 variables: {
277 q: Schema.String,
278 first: Shared.Int,
279 after: Schema.optional(Schema.NullOr(Schema.String)),
280 stacks: Schema.Boolean,
281 stats: Schema.Boolean
282 },
283 result: Schema.Struct({
284 /** Perform a search across resources, returning a maximum of 1,000 results. */
285 search: SearchResultItemConnection
286 })
287})
288export declare namespace PullRequestSearch {
289 export type Variables = typeof PullRequestSearch.variables.Type
290 export type Result = typeof PullRequestSearch.result.Type
292​
293/** The connection type for PullRequest. */
294export const PullRequestConnection = Schema.Struct({
295 /** Information to aid in pagination. */
296 pageInfo: PageInfo,
297 /** A list of nodes. */
298 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(PullRequestRow)))
299})
300export interface PullRequestConnection extends Schema.Struct.Type<typeof PullRequestConnection.fields> {}
301​
302/** A repository contains the content for a project. */
303export const PullRequestListRepositoryRepository = Schema.Struct({
304 /** A list of pull requests that have been opened in the repository. */
305 pullRequests: PullRequestConnection
306})
307export interface PullRequestListRepositoryRepository extends Schema.Struct.Type<typeof PullRequestListRepositoryRepository.fields> {}
308​
309/** `query PullRequestList` */
310export const PullRequestList = GraphQL.query("PullRequestList", {
311 document: {
312 variables: [
313 { name: "owner", body: "String!" },
314 { name: "name", body: "String!" },
315 { name: "states", body: "[PullRequestState!]" },
316 { name: "first", body: "Int!" },
317 { name: "after", body: "String" },
318 { name: "stacks", body: "Boolean!" },
319 { name: "stats", body: "Boolean!" }
320 ],
321 selections: [
322 { name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequests(first:$", "first", " after:$", "after", " states:$", "states", " orderBy:{field:CREATED_AT direction:DESC}){pageInfo{hasNextPage endCursor}nodes{...", "PullRequestRow", "}}}"] }
323 ],
324 fragments: [
325 { name: "PullRequestRow", body: ["on PullRequest{stack@include(if:$", "stacks", "){number size baseRefName}stackEntry@include(if:$", "stacks", "){position}number title url author{__typename login avatarUrl...on User{name}}headRefName baseRefName state isDraft mergeable reviewDecision latestReviews(first:20){nodes{state isMinimized author{__typename login}}}additions@include(if:$", "stats", ")deletions@include(if:$", "stats", ")createdAt updatedAt mergedAt repository{nameWithOwner}reviewRequests(first:20){nodes{requestedReviewer{__typename...on User{login}...on Team{slug}}}}labels(first:20){nodes{name color description}}commits(last:1){nodes{commit{statusCheckRollup{state}}}}}"] }
326 ]
327 },
328 variables: {
329 owner: Schema.String,
330 name: Schema.String,
331 states: Schema.optional(Schema.NullOr(Schema.Array(Shared.PullRequestState))),
332 first: Shared.Int,
333 after: Schema.optional(Schema.NullOr(Schema.String)),
334 stacks: Schema.Boolean,
335 stats: Schema.Boolean
336 },
337 result: Schema.Struct({
338 /** Lookup a given repository by the owner and repository name. */
339 repository: Schema.NullOr(PullRequestListRepositoryRepository)
340 })
341})
342export declare namespace PullRequestList {
343 export type Variables = typeof PullRequestList.variables.Type
344 export type Result = typeof PullRequestList.result.Type
346​
347/** Every operation in pullRequestListings.graphql. */
348export const PullRequestListingsGraphQLGroup = GraphQLGroup.make(PullRequestSearch, PullRequestList)