{"id":47774,"library":"github-schema","title":"github-schema","description":"A TypeScript package that provides the complete GitHub GraphQL schema as a single, self-contained module. Version 1.28.0 ships the latest schema as of release, with automatic updates triggered by schema changes on GitHub's API. Differentiates from alternatives like @octokit/graphql-schema by being zero-dependency, fully typed, and focused solely on schema definitions without client logic. Ideal for code generation, IDE autocomplete, and type-safe GraphQL queries. Released on npm with a cadence tied to GitHub GraphQL schema updates.","status":"active","version":"1.28.0","language":"javascript","source_language":"en","source_url":"https://github.com/luxass/github-schema","tags":["javascript","github","github graphql","github schema","graphql","typescript"],"install":[{"cmd":"npm install github-schema","lang":"bash","label":"npm"},{"cmd":"yarn add github-schema","lang":"bash","label":"yarn"},{"cmd":"pnpm add github-schema","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only; no CommonJS support.","wrong":"const schema = require('github-schema')","symbol":"schema","correct":"import { schema } from 'github-schema'"},{"note":"Schema is a TypeScript type, not a runtime value. Use 'import type' for type-only imports.","wrong":"import { Schema } from 'github-schema'","symbol":"Schema","correct":"import type { Schema } from 'github-schema'"},{"note":"allSchemas is available from a subpath export; not part of the main module.","wrong":"import { allSchemas } from 'github-schema'","symbol":"allSchemas","correct":"import { allSchemas } from 'github-schema/schemas'"}],"quickstart":{"code":"import { schema } from 'github-schema';\nimport { printSchema } from 'graphql';\n\n// schema is a GraphQLSchema object\nconsole.log(printSchema(schema));\n\n// Example: query type fields\nconst queryFields = schema.getQueryType()?.getFields();\nif (queryFields) {\n  Object.keys(queryFields).forEach(field => console.log(field));\n}","lang":"typescript","description":"Import the GitHub GraphQL schema and use it with graphql utilities to inspect types."},"warnings":[{"fix":"Use ESM imports (import { schema } from 'github-schema') and ensure Node.js >=20.","message":"Version 1.0.0 dropped CommonJS support; require() will fail.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Check release date and compare with GitHub changelog if you need the latest schema.","message":"Schema is regenerated only on package release; may lag behind live GitHub schema.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use a bundler that supports package.json exports field, like webpack 5 or esbuild.","message":"Subpath exports (e.g., 'github-schema/schemas') require modern Node.js module resolution; may not work with older bundlers.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"import { schema } from 'github-schema' (main export already includes the latest schema).","message":"The 'github-schema/schemas' export path is deprecated; use 'github-schema/schema' instead.","severity":"deprecated","affected_versions":">=1.20.0"}],"env_vars":null,"search_vec":"'1.28.0':22 'altern':43 'api':40 'autocomplet':67 'automat':31 'cadenc':79 'chang':36 'client':60 'code':64 'complet':10 'contain':19 'definit':58 'depend':50 'differenti':41 'focus':54 'fulli':51 'generat':65 'github':2,11,38,82,87,88,90 'github-schema':1 'graphql':12,72,83,89,92 'ide':66 'ideal':62 'javascript':86 'latest':25 'like':44 'logic':61 'modul':20 'npm':76 'octokit/graphql-schema':45 'packag':6 'provid':8 'queri':73 'releas':29,74 'safe':71 'schema':3,13,26,35,57,84,91 'self':18 'self-contain':17 'ship':23 'singl':16 'sole':55 'tie':80 'trigger':33 'type':52,70 'type-saf':69 'typescript':5,93 'updat':32,85 'version':21 'without':59 'zero':49 'zero-depend':48","created_at":"2026-06-07T16:53:15.044906+00:00","updated_at":"2026-06-07T16:53:15.044906+00:00","problems":[{"fix":"Use 'github-schema' main export or check documentation for correct subpath.","cause":"Importing from 'github-schema/schemas' which may have been removed or renamed.","error":"ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './schemas' is not defined by \"exports\""},{"fix":"Add \"type\": \"module\" to package.json or use .mjs extension.","cause":"Using ESM import in a CommonJS context (e.g., Node.js without \"type\": \"module\").","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Ensure you are importing the default export: import { schema } from 'github-schema'.","cause":"schema is not a GraphQLSchema object but a plain object (wrong import).","error":"TypeError: schema.getQueryType is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/luxass/github-schema","github":"https://github.com/luxass/github-schema","docs":null,"changelog":null,"pypi":null,"npm":"github-schema","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}