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