capability_id: pr.create
version: "1.0.0"
description: Create a pull request.
input_schema:
  type: object
  required: [owner, name, title, head, base]
  properties:
    owner: { type: string, minLength: 1 }
    name: { type: string, minLength: 1 }
    title: { type: string, minLength: 1 }
    body: { type: string }
    head: { type: string, minLength: 1 }
    base: { type: string, minLength: 1 }
    draft: { type: boolean }
  additionalProperties: false
output_schema:
  type: object
  required: [number, url, title, state, draft]
  properties:
    number: { type: integer, minimum: 1 }
    url: { type: string, minLength: 1 }
    title: { type: string }
    state: { type: string }
    draft: { type: boolean }
  additionalProperties: false
routing:
  preferred: graphql
  fallbacks: [cli]
graphql:
  operationName: PrCreate
  operationType: mutation
  documentPath: src/gql/operations/pr-create.graphql
  resolution:
    lookup:
      operationName: IssueCreateRepositoryId
      documentPath: src/gql/operations/issue-create-repository-id.graphql
      vars:
        owner: owner
        name: name
    inject:
      - target: repositoryId
        source: scalar
        path: repository.id
      - target: baseRefName
        source: input
        from_input: base
      - target: headRefName
        source: input
        from_input: head
cli:
  command: pr create
