// Generated by @effect/graphql-generator from sourceControlProvider.graphql. Do not edit.
import { GraphQL, GraphQLGroup } from "effect/graphql"
import * as Schema from "effect/Schema"
import * as Shared from "../../schema/github.graphql.ts"
/** A repository contains the content for a project. */
export const HeadRepositoryRepository = Schema.Struct({
/** The name of the repository. */
name: Schema.String,
/** The repository's name with owner. */
nameWithOwner: Schema.String
})
export interface HeadRepositoryRepository extends Schema.Struct.Type<typeof HeadRepositoryRepository.fields> {}
/** Represents an owner of a Repository. */
export const RepositoryOwner = Schema.Struct({
__typename: GraphQL.otherTypename<Shared.Typename.RepositoryOwner>()([]),
/** The username used to login. */
login: Schema.String
})
export interface RepositoryOwner extends Schema.Struct.Type<typeof RepositoryOwner.fields> {}
/**
* `fragment PullRequestNode on PullRequest`
*
* A repository pull request.
*/
export const PullRequestNode = Schema.Struct({
/** Identifies the pull request number. */
number: Shared.Int,
/** Identifies the pull request title. */
title: Schema.String,
/** The HTTP URL for this pull request. */
url: Shared.URI,
/** Identifies the name of the base Ref associated with the pull request, even if the ref has been deleted. */
baseRefName: Schema.String,
/** Identifies the name of the head Ref associated with the pull request, even if the ref has been deleted. */
headRefName: Schema.String,
/** Identifies the oid of the head ref associated with the pull request, even if the ref has been deleted. */
headRefOid: Shared.GitObjectID,
/** Identifies the state of the pull request. */
state: GraphQL.enumLiterals(Shared.PullRequestState.literals),
/** Identifies if the pull request is a draft. */
isDraft: Schema.Boolean,
/** The date and time that the pull request was merged. */
mergedAt: Schema.NullOr(Shared.DateTime),
/** Identifies the date and time when the object was closed. */
closedAt: Schema.NullOr(Shared.DateTime),
/** Identifies the date and time when the object was last updated. */
updatedAt: Shared.DateTime,
/** The head and base repositories are different. */
isCrossRepository: Schema.Boolean,
/** The repository associated with this pull request's head Ref. */
headRepository: Schema.NullOr(HeadRepositoryRepository),
/** The owner of the repository associated with this pull request's head Ref. */
headRepositoryOwner: Schema.NullOr(RepositoryOwner)
})
export interface PullRequestNode extends Schema.Struct.Type<typeof PullRequestNode.fields> {}
/** The connection type for PullRequest. */
export const PullRequestConnection = Schema.Struct({
/** A list of nodes. */
nodes: Schema.NullOr(Schema.Array(Schema.NullOr(PullRequestNode)))
})
export interface PullRequestConnection extends Schema.Struct.Type<typeof PullRequestConnection.fields> {}
/** A repository contains the content for a project. */
export const PullRequestsByHeadRepositoryRepository = Schema.Struct({
/** A list of pull requests that have been opened in the repository. */
pullRequests: PullRequestConnection
})
export interface PullRequestsByHeadRepositoryRepository extends Schema.Struct.Type<typeof PullRequestsByHeadRepositoryRepository.fields> {}
/** `query PullRequestsByHead` */
export const PullRequestsByHead = GraphQL.query("PullRequestsByHead", {
document: {
variables: [
{ name: "owner", body: "String!" },
{ name: "name", body: "String!" },
{ name: "head", body: "String!" },
{ name: "states", body: "[PullRequestState!]" },
{ name: "first", body: "Int!" }
],
selections: [
{ name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequests(headRefName:$", "head", " states:$", "states", " first:$", "first", " orderBy:{field:CREATED_AT direction:DESC}){nodes{...PullRequestNode}}}"] }
],
fragments: [
{ name: "PullRequestNode", body: ["on PullRequest{number title url baseRefName headRefName headRefOid state isDraft mergedAt closedAt updatedAt isCrossRepository headRepository{name nameWithOwner}headRepositoryOwner{__typename login}}"] }
]
},
variables: {
owner: Schema.String,
name: Schema.String,
head: Schema.String,
states: Schema.optional(Schema.NullOr(Schema.Array(Shared.PullRequestState))),
first: Shared.Int
},
result: Schema.Struct({
/** Lookup a given repository by the owner and repository name. */
repository: Schema.NullOr(PullRequestsByHeadRepositoryRepository)
})
})
export declare namespace PullRequestsByHead {
export type Variables = typeof PullRequestsByHead.variables.Type
export type Result = typeof PullRequestsByHead.result.Type
}
/** A repository contains the content for a project. */
export const PullRequestByNumberRepositoryRepository = Schema.Struct({
/** Returns a single pull request from the current repository by number. */
pullRequest: Schema.NullOr(PullRequestNode)
})
export interface PullRequestByNumberRepositoryRepository extends Schema.Struct.Type<typeof PullRequestByNumberRepositoryRepository.fields> {}
/** `query PullRequestByNumber` */
export const PullRequestByNumber = GraphQL.query("PullRequestByNumber", {
document: {
variables: [
{ name: "owner", body: "String!" },
{ name: "name", body: "String!" },
{ name: "number", body: "Int!" }
],
selections: [
{ name: "repository", body: ["(owner:$", "owner", " name:$", "name", "){pullRequest(number:$", "number", "){...PullRequestNode}}"] }
],
fragments: [
{ name: "PullRequestNode", body: ["on PullRequest{number title url baseRefName headRefName headRefOid state isDraft mergedAt closedAt updatedAt isCrossRepository headRepository{name nameWithOwner}headRepositoryOwner{__typename login}}"] }
]
},
variables: {
owner: Schema.String,
name: Schema.String,
number: Shared.Int
},
result: Schema.Struct({
/** Lookup a given repository by the owner and repository name. */
repository: Schema.NullOr(PullRequestByNumberRepositoryRepository)
})
})
export declare namespace PullRequestByNumber {
export type Variables = typeof PullRequestByNumber.variables.Type
export type Result = typeof PullRequestByNumber.result.Type
}
/** Every operation in sourceControlProvider.graphql. */
export const SourceControlProviderGraphQLGroup = GraphQLGroup.make(PullRequestsByHead, PullRequestByNumber)