# @octokit/graphql-schema

> GitHub's GraphQL Schema with validation. Automatically updated.

Latest version **15.26.1** (published 2025-11-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @octokit/graphql-schema
pnpm add @octokit/graphql-schema
yarn add @octokit/graphql-schema
bun add @octokit/graphql-schema
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 15.26.1 |
| Published | 2025-11-24 |
| First published | 2018-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 207 |
| Author | Gregor Martynus |
| Maintainers | octokitbot |
| Keywords | github, graphql, schema, validation |

## Links

- npm: https://www.npmjs.com/package/@octokit/graphql-schema
- Repository: https://github.com/octokit/graphql-schema
- Homepage: https://github.com/octokit/graphql-schema#readme
- Issues: https://github.com/octokit/graphql-schema/issues
- npm.io page: https://npm.io/package/@octokit/graphql-schema

## Dependencies (2)

- [graphql](https://npm.io/package/graphql.md) ^16.0.0
- [graphql-tag](https://npm.io/package/graphql-tag.md) ^2.10.3

## Alternatives

- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@regle/core](https://npm.io/package/@regle/core.md) — 47.0K weekly downloads
- [typeof-arguments](https://npm.io/package/typeof-arguments.md) — 12.5K weekly downloads
- [@lokalise/projects-engine-contracts](https://npm.io/package/@lokalise/projects-engine-contracts.md) — 978 weekly downloads
- [@osjwnpm/nam-laboriosam-quibusdam](https://npm.io/package/@osjwnpm/nam-laboriosam-quibusdam.md) — 70 weekly downloads

## Recent versions

- 15.26.1 (latest) — 2025-11-24
- 15.0.0-beta.4 (beta) — 2024-03-04
- 15.26.0 — 2025-02-27
- 15.25.0 — 2024-07-08
- 15.24.0 — 2024-07-03
- 15.23.0 — 2024-06-28
- 15.22.0 — 2024-06-21
- 15.21.0 — 2024-06-20
- 15.20.0 — 2024-06-14
- 15.19.0 — 2024-06-13
- 15.18.1 — 2024-06-11
- 15.18.0 — 2024-05-24
- 15.17.0 — 2024-05-20
- 15.16.0 — 2024-05-16
- 15.15.0 — 2024-05-02
- … 447 more at https://npm.io/package/@octokit/graphql-schema/versions

## README

# graphql-schema

> GitHub’s GraphQL Schema with validation. Automatically updated.

![Test](https://github.com/octokit/graphql-schema/workflows/Test/badge.svg)

## Usage

### Validation

```js
import { validate } from "@octokit/graphql-schema";
const errors = validate(`
{
  viewer {
    login
  }
}
`);

// errors is array. Contains errors if any
```

You can also load the current Schema directly as JSON or [IDL](https://en.wikipedia.org/wiki/Interface_description_language).

```js
import { schema } from "@octokit/graphql-schema";
schema.json; // JSON version
schema.idl; // IDL version
```

### Schema as Types

```ts
import { graphql } from "@octokit/graphql";
import { Repository } from "@octokit/graphql-schema";

const { repository } = await graphql<{ repository: Repository }>(
  `
    {
      repository(owner: "octokit", name: "graphql.js") {
        issues(last: 3) {
          edges {
            node {
              title
            }
          }
        }
      }
    }
  `,
  {
    headers: {
      authorization: `token secret123`,
    },
  },
);
```

## Local setup

```
git clone https://github.com/octokit/graphql-schema.git
cd graphql-schema
npm install
npm test
```

Update schema files (`GITHUB_TOKEN` requires no scope)

```
GITHUB_TOKEN=... npm run update
```

## See also

- [octokit/openapi](https://github.com/octokit/openapi) – GitHub's OpenAPI specification with `x-octokit` extension
- [octokit/webhooks](https://github.com/octokit/webhooks) – GitHub Webhooks specifications
- [octokit/app-permissions](https://github.com/octokit/app-permissions) – GitHub App permission specifications

## LICENSE

[MIT](LICENSE.md)

---
_Source: https://npm.io/package/@octokit/graphql-schema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
