Socket
Book a DemoInstallSign in
Socket

@octokit/graphql-schema

Package Overview
Dependencies
Maintainers
4
Versions
461
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/graphql-schema

GitHub’s GraphQL Schema with validation. Automatically updated.

15.26.0
latest
Source
npmnpm
Version published
Weekly downloads
164K
5.64%
Maintainers
4
Weekly downloads
 
Created
Source

graphql-schema

GitHub’s GraphQL Schema with validation. Automatically updated.

Test

Usage

Validation

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.

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

Schema as Types

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

LICENSE

MIT

Keywords

github

FAQs

Package last updated on 27 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.