Socket
Socket
Sign inDemoInstall

github-schema

Package Overview
Dependencies
Maintainers
0
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-schema

GitHub's GraphQL schema


Version published
Weekly downloads
6
decreased by-57.14%
Maintainers
0
Weekly downloads
 
Created
Source

📋 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.

Keywords

FAQs

Package last updated on 05 Oct 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc