Open History to see the last commit
1// Generated by @effect/graphql-generator from sourceControlProvider.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 repository contains the content for a project. */
7export const HeadRepositoryRepository = Schema.Struct({
8 /** The name of the repository. */
9 name: Schema.String,
10 /** The repository's name with owner. */
11 nameWithOwner: Schema.String
12})
13export interface HeadRepositoryRepository extends Schema.Struct.Type<typeof HeadRepositoryRepository.fields> {}
14
15/** Represents an owner of a Repository. */
16export const RepositoryOwner = Schema.Struct({
17 __typename: GraphQL.otherTypename<Shared.Typename.RepositoryOwner>()([]),
18 /** The username used to login. */
19 login: Schema.String
20})
21export interface RepositoryOwner extends Schema.Struct.Type<typeof RepositoryOwner.fields> {}
22
23/**
24 * `fragment PullRequestNode on PullRequest`
25 *
26 * A repository pull request.
27 */
28export const PullRequestNode = Schema.Struct({
29 /** Identifies the pull request number. */
30 number: Shared.Int,
31 /** Identifies the pull request title. */
32 title: Schema.String,
33 /** The HTTP URL for this pull request. */
34 url: Shared.URI,
35 /** Identifies the name of the base Ref associated with the pull request, even if the ref has been deleted. */
36 baseRefName: Schema.String,
37 /** Identifies the name of the head Ref associated with the pull request, even if the ref has been deleted. */
38 headRefName: Schema.String,
39 /** Identifies the oid of the head ref associated with the pull request, even if the ref has been deleted. */
40 headRefOid: Shared.GitObjectID,
41 /** Identifies the state of the pull request. */
42 state: GraphQL.enumLiterals(Shared.PullRequestState.literals),
43 /** Identifies if the pull request is a draft. */
44 isDraft: Schema.Boolean,
45 /** The date and time that the pull request was merged. */
46 mergedAt: Schema.NullOr(Shared.DateTime),
47 /** Identifies the date and time when the object was closed. */
48 closedAt: Schema.NullOr(Shared.DateTime),
49 /** Identifies the date and time when the object was last updated. */
50 updatedAt: Shared.DateTime,
51 /** The head and base repositories are different. */
52 isCrossRepository: Schema.Boolean,
53 /** The repository associated with this pull request's head Ref. */
54 headRepository: Schema.NullOr(HeadRepositoryRepository),
55 /** The owner of the repository associated with this pull request's head Ref. */
56 headRepositoryOwner: Schema.NullOr(RepositoryOwner)
57})
58export interface PullRequestNode extends Schema.Struct.Type<typeof PullRequestNode.fields> {}
59
60/** The connection type for PullRequest. */
61export const PullRequestConnection = Schema.Struct({
62 /** A list of nodes. */
63 nodes: Schema.NullOr(Schema.Array(Schema.NullOr(PullRequestNode)))
64})
65export interface PullRequestConnection extends Schema.Struct.Type<typeof PullRequestConnection.fields> {}
66
67/** A repository contains the content for a project. */
68export const PullRequestsByHeadRepositoryRepository = Schema.Struct({
69 /** A list of pull requests that have been opened in the repository. */
70 pullRequests: PullRequestConnection
71})
72export interface PullRequestsByHeadRepositoryRepository extends Schema.Struct.Type<typeof PullRequestsByHeadRepositoryRepository.fields> {}
73
74/** `query PullRequestsByHead` */
75export const PullRequestsByHead = GraphQL.query("PullRequestsByHead", {
76 document: {
77 variables: [
78 { name: "owner", body: "String!" },
79 { name: "name", body: "String!" },
80 { name: "head", body: "String!" },
81 { name: "states", body: "[PullRequestState!]" },
82 { name: "first", body: "Int!" }
83 ],
84 selections: [
85 { name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequests(headRefName:$", "head", " states:$", "states", " first:$", "first", " orderBy:{field:CREATED_AT direction:DESC}){nodes{...PullRequestNode}}}"] }
86 ],
87 fragments: [
88 { name: "PullRequestNode", body: ["on PullRequest{number title url baseRefName headRefName headRefOid state isDraft mergedAt closedAt updatedAt isCrossRepository headRepository{name nameWithOwner}headRepositoryOwner{__typename login}}"] }
89 ]
90 },
91 variables: {
92 owner: Schema.String,
93 name: Schema.String,
94 head: Schema.String,
95 states: Schema.optional(Schema.NullOr(Schema.Array(Shared.PullRequestState))),
96 first: Shared.Int
97 },
98 result: Schema.Struct({
99 /** Lookup a given repository by the owner and repository name. */
100 repository: Schema.NullOr(PullRequestsByHeadRepositoryRepository)
101 })
102})
103export declare namespace PullRequestsByHead {
104 export type Variables = typeof PullRequestsByHead.variables.Type
105 export type Result = typeof PullRequestsByHead.result.Type
106}
107
108/** A repository contains the content for a project. */
109export const PullRequestByNumberRepositoryRepository = Schema.Struct({
110 /** Returns a single pull request from the current repository by number. */
111 pullRequest: Schema.NullOr(PullRequestNode)
112})
113export interface PullRequestByNumberRepositoryRepository extends Schema.Struct.Type<typeof PullRequestByNumberRepositoryRepository.fields> {}
114
115/** `query PullRequestByNumber` */
116export const PullRequestByNumber = GraphQL.query("PullRequestByNumber", {
117 document: {
118 variables: [
119 { name: "owner", body: "String!" },
120 { name: "name", body: "String!" },
121 { name: "number", body: "Int!" }
122 ],
123 selections: [
124 { name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequest(number:$", "number", "){...PullRequestNode}}"] }
125 ],
126 fragments: [
127 { name: "PullRequestNode", body: ["on PullRequest{number title url baseRefName headRefName headRefOid state isDraft mergedAt closedAt updatedAt isCrossRepository headRepository{name nameWithOwner}headRepositoryOwner{__typename login}}"] }
128 ]
129 },
130 variables: {
131 owner: Schema.String,
132 name: Schema.String,
133 number: Shared.Int
134 },
135 result: Schema.Struct({
136 /** Lookup a given repository by the owner and repository name. */
137 repository: Schema.NullOr(PullRequestByNumberRepositoryRepository)
138 })
139})
140export declare namespace PullRequestByNumber {
141 export type Variables = typeof PullRequestByNumber.variables.Type
142 export type Result = typeof PullRequestByNumber.result.Type
143}
144
145/** Every operation in sourceControlProvider.graphql. */
146export const SourceControlProviderGraphQLGroup = GraphQLGroup.make(PullRequestsByHead, PullRequestByNumber)