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