nuknal / graphql-schema

GitHub’s GraphQL Schema with validation. Automatically updated.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

graphql-schema

GitHub’s GraphQL Schema with validation. Automatically updated.

Build Status Greenkeeper badge

Usage

const {validate} = require('@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.

const {schema} = require('@octokit/graphql-schema')
schema.json // JSON version
schema.idl // IDL version

Local setup

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

Update schema files (GH_TOKEN requires no scope)

GH_TOKEN=... bin/download.js

Create pull request (after schema files changed). This script is run daily on Travis CI. The token requires public_repo scope.

GH_TOKEN=... TRAVIS_REPO_SLUG=octokit/graphql-schema bin/create-pull-request.js

See also

LICENSE

MIT

About

GitHub’s GraphQL Schema with validation. Automatically updated.

License:MIT License


Languages

Language:JavaScript 100.0%