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 /** 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})
126export interface Label extends Schema.Struct.Type<typeof Label.fields> {}
127
128/** The connection type for Label. */
129export const LabelConnection = Schema.Struct({
130 /** A list of nodes. */
131 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(Label)))
132})
133export interface LabelConnection extends Schema.Struct.Type<typeof LabelConnection.fields> {}
134
135/** Represents the rollup for both the check runs and status for a commit. */
136export const StatusCheckRollup = Schema.Struct({
137 /** The combined status for the commit. */
138 state: GraphQL.enumLiterals(Shared.StatusState.literals)
139})
140export interface StatusCheckRollup extends Schema.Struct.Type<typeof StatusCheckRollup.fields> {}
141
142/** Represents a Git commit. */
143export const Commit = Schema.Struct({
144 /** Check and Status rollup information for this commit. */
145 statusCheckRollup: Schema.NullOr(StatusCheckRollup)
146})
147export interface Commit extends Schema.Struct.Type<typeof Commit.fields> {}
148
149/** Represents a Git commit part of a pull request. */
150export const PullRequestCommit = Schema.Struct({
151 /** The Git commit object */
152 commit: Commit
153})
154export interface PullRequestCommit extends Schema.Struct.Type<typeof PullRequestCommit.fields> {}
155
156/** The connection type for PullRequestCommit. */
157export const PullRequestCommitConnection = Schema.Struct({
158 /** A list of nodes. */
159 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(PullRequestCommit)))
160})
161export interface PullRequestCommitConnection extends Schema.Struct.Type<typeof PullRequestCommitConnection.fields> {}
162
163/**
164 * `fragment PullRequestRow on PullRequest`
165 *
166 * A repository pull request.
167 */
168export const PullRequestRow = Schema.Struct({
169 /** The stack this Pull Request belongs to, or null if it is not part of a stack */
170 stack: Schema.optionalKey(Schema.NullOr(PullRequestStack)),
171 /** The stack entry for this Pull Request, or null if it is not part of a stack */
172 stackEntry: Schema.optionalKey(Schema.NullOr(PullRequestStackEntry)),
173 /** Identifies the pull request number. */
174 number: Shared.Int,
175 /** Identifies the pull request title. */
176 title: Schema.String,
177 /** The HTTP URL for this pull request. */
178 url: Shared.URI,
179 /** The actor who authored the comment. */
180 author: Schema.NullOr(Schema.Union([
181 AuthorUser,
182 ActorOther
183 ])),
184 /** Identifies the name of the head Ref associated with the pull request, even if the ref has been deleted. */
185 headRefName: Schema.String,
186 /** Identifies the name of the base Ref associated with the pull request, even if the ref has been deleted. */
187 baseRefName: Schema.String,
188 /** Identifies the state of the pull request. */
189 state: GraphQL.enumLiterals(Shared.PullRequestState.literals),
190 /** Identifies if the pull request is a draft. */
191 isDraft: Schema.Boolean,
192 /** Whether or not the pull request can be merged based on the existence of merge conflicts. */
193 mergeable: GraphQL.enumLiterals(Shared.MergeableState.literals),
194 /** The current status of this pull request with respect to code review. */
195 reviewDecision: Schema.NullOr(GraphQL.enumLiterals(Shared.PullRequestReviewDecision.literals)),
196 /** A list of latest reviews per user associated with the pull request that are not also pending review. */
197 latestReviews: Schema.NullOr(PullRequestReviewConnection),
198 /** The number of additions in this pull request. */
199 additions: Schema.optionalKey(Shared.Int),
200 /** The number of deletions in this pull request. */
201 deletions: Schema.optionalKey(Shared.Int),
202 /** Identifies the date and time when the object was created. */
203 createdAt: Shared.DateTime,
204 /** Identifies the date and time when the object was last updated. */
205 updatedAt: Shared.DateTime,
206 /** The date and time that the pull request was merged. */
207 mergedAt: Schema.NullOr(Shared.DateTime),
208 /** The repository associated with this node. */
209 repository: PullRequestRowRepositoryRepository,
210 /** A list of review requests associated with the pull request. */
211 reviewRequests: Schema.NullOr(ReviewRequestConnection),
212 /** A list of labels associated with the object. */
213 labels: Schema.NullOr(LabelConnection),
214 /** A list of commits present in this pull request's head branch not present in the base branch. */
215 commits: PullRequestCommitConnection
216})
217export interface PullRequestRow extends Schema.Struct.Type<typeof PullRequestRow.fields> {}
218
219/** Information about pagination in a connection. */
220export const PageInfo = Schema.Struct({
221 /** When paginating forwards, are there more items? */
222 hasNextPage: Schema.Boolean,
223 /** When paginating forwards, the cursor to continue. */
224 endCursor: Schema.NullOr(Schema.String)
225})
226export interface PageInfo extends Schema.Struct.Type<typeof PageInfo.fields> {}
227
228/** A repository pull request. */
229export const PullRequest = Schema.Struct({
230 __typename: Schema.Literal("PullRequest"),
231 ...PullRequestRow.fields
232})
233export interface PullRequest extends Schema.Struct.Type<typeof PullRequest.fields> {}
234
235/** The results of a search. */
236export const SearchResultItemOther = Schema.Struct({
237 __typename: GraphQL.otherTypename<Shared.Typename.SearchResultItem>()(["PullRequest"])
238})
239export interface SearchResultItemOther extends Schema.Struct.Type<typeof SearchResultItemOther.fields> {}
240
241/**
242 * A list of results that matched against a search query. Regardless of the number
243 * of matches, a maximum of 1,000 results will be available across all types,
244 * potentially split across many pages.
245 */
246export const SearchResultItemConnection = Schema.Struct({
247 /** Information to aid in pagination. */
248 pageInfo: PageInfo,
249 /** A list of nodes. */
250 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(Schema.Union([
251 PullRequest,
252 SearchResultItemOther
253 ]))))
254})
255export interface SearchResultItemConnection extends Schema.Struct.Type<typeof SearchResultItemConnection.fields> {}
256
257/** `query PullRequestSearch` */
258export const PullRequestSearch = GraphQL.query("PullRequestSearch", {
259 document: {
260 variables: [
261 { name: "q", body: "String!" },
262 { name: "first", body: "Int!" },
263 { name: "after", body: "String" },
264 { name: "stacks", body: "Boolean!" },
265 { name: "stats", body: "Boolean!" }
266 ],
267 selections: [
268 { name: "search", body: ["(query:$", "q", " type:ISSUE first:$", "first", " after:$", "after", "){pageInfo{hasNextPage endCursor}nodes{__typename...", "PullRequestRow", "}}"] }
269 ],
270 fragments: [
271 { 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}}commits(last:1){nodes{commit{statusCheckRollup{state}}}}}"] }
272 ]
273 },
274 variables: {
275 q: Schema.String,
276 first: Shared.Int,
277 after: Schema.optional(Schema.NullOr(Schema.String)),
278 stacks: Schema.Boolean,
279 stats: Schema.Boolean
280 },
281 result: Schema.Struct({
282 /** Perform a search across resources, returning a maximum of 1,000 results. */
283 search: SearchResultItemConnection
284 })
285})
286export declare namespace PullRequestSearch {
287 export type Variables = typeof PullRequestSearch.variables.Type
288 export type Result = typeof PullRequestSearch.result.Type
289}
290
291/** The connection type for PullRequest. */
292export const PullRequestConnection = Schema.Struct({
293 /** Information to aid in pagination. */
294 pageInfo: PageInfo,
295 /** A list of nodes. */
296 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(PullRequestRow)))
297})
298export interface PullRequestConnection extends Schema.Struct.Type<typeof PullRequestConnection.fields> {}
299
300/** A repository contains the content for a project. */
301export const PullRequestListRepositoryRepository = Schema.Struct({
302 /** A list of pull requests that have been opened in the repository. */
303 pullRequests: PullRequestConnection
304})
305export interface PullRequestListRepositoryRepository extends Schema.Struct.Type<typeof PullRequestListRepositoryRepository.fields> {}
306
307/** `query PullRequestList` */
308export const PullRequestList = GraphQL.query("PullRequestList", {
309 document: {
310 variables: [
311 { name: "owner", body: "String!" },
312 { name: "name", body: "String!" },
313 { name: "states", body: "[PullRequestState!]" },
314 { name: "first", body: "Int!" },
315 { name: "after", body: "String" },
316 { name: "stacks", body: "Boolean!" },
317 { name: "stats", body: "Boolean!" }
318 ],
319 selections: [
320 { 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", "}}}"] }
321 ],
322 fragments: [
323 { 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}}commits(last:1){nodes{commit{statusCheckRollup{state}}}}}"] }
324 ]
325 },
326 variables: {
327 owner: Schema.String,
328 name: Schema.String,
329 states: Schema.optional(Schema.NullOr(Schema.Array(Shared.PullRequestState))),
330 first: Shared.Int,
331 after: Schema.optional(Schema.NullOr(Schema.String)),
332 stacks: Schema.Boolean,
333 stats: Schema.Boolean
334 },
335 result: Schema.Struct({
336 /** Lookup a given repository by the owner and repository name. */
337 repository: Schema.NullOr(PullRequestListRepositoryRepository)
338 })
339})
340export declare namespace PullRequestList {
341 export type Variables = typeof PullRequestList.variables.Type
342 export type Result = typeof PullRequestList.result.Type
343}
344
345/** Every operation in pullRequestListings.graphql. */
346export const PullRequestListingsGraphQLGroup = GraphQLGroup.make(PullRequestSearch, PullRequestList)