Go Back to projects

github-schema

GitHub’s GraphQL Schema

📦 Installation

npm install github-schema

📚 Usage

import { gql, gqlTyped } from "github-schema";

// we are also exporting a ton of types from the graphql schema.

const REPOSITORY_QUERY = gql`
  query getRepository($owner: String!, $name: String!) {
    repository(owner: $owner, name: $name) {
      nameWithOwner
      description
      pushedAt
      url
      defaultBranchRef {
        name
      }
      languages(first: 1, orderBy: { field: SIZE, direction: DESC }) {
        nodes {
          name
          color
        }
      }
    }
  }
`;
import { gqlTyped } from "github-schema";

Editor Autocompletion

# .graphqlrc.yaml
schema: node_modules/github-schema/schema.graphql

📄 License

Published under MIT License.