Skip to main content

GitHub's GraphQL schema

Works with
This package works with Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Browsers
JSR Score
100%
Published
2 weeks ago (1.7.12)

📋 github-schema

npm version npm downloads

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
        }
      }
    }
  }
`
Note

If you want to use gql with return type of DocumentNode you can do something like this:

import { gqlTyped } from 'github-schema'

Editor Autocompletion

Tip

You will need to have GraphQL LSP installed, and have a .graphqlrc.yaml file in your project root. If you also want nice colors, i would recommend GraphQL Syntax Highlighting installed.

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

📄 License

Published under MIT License.

Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @luxass/github-schema

Import symbol

import * as mod from "@luxass/github-schema";

Add Package

npx jsr add @luxass/github-schema

Import symbol

import * as mod from "@luxass/github-schema";

Add Package

yarn dlx jsr add @luxass/github-schema

Import symbol

import * as mod from "@luxass/github-schema";

Add Package

pnpm dlx jsr add @luxass/github-schema

Import symbol

import * as mod from "@luxass/github-schema";

Add Package

bunx jsr add @luxass/github-schema

Import symbol

import * as mod from "@luxass/github-schema";