MCPcopy Index your code
hub / github.com/CDThomas/graphql-json-to-sdl

github.com/CDThomas/graphql-json-to-sdl @v0.5.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.5.0 ↗ · + Follow
17 symbols 29 edges 4 files 0 documented · 0% updated 2y agov0.5.0 · 2023-01-06★ 33
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

graphql-json-to-sdl

Version Codecov Downloads/week License

A command line utility for converting a JSON GraphQL schema to GraphQL SDL.

This is useful when you only have a JSON GraphQL schema (e.g. from a code-first GraphQL library that can only produce schemas as .json files) but you need an SDL schema (i.e. .graphql file) for other tooling.

Fields from the JSON schema are sorted before writing the SDL file. This allows for consistent SDL output even when using a GraphQL library that produces JSON schemas with nondeterministic field order.

Usage

$ graphql-json-to-sdl SRC OUT

Arguments:

  • SRC: The JSON GraphQL schema to convert
  • OUT: The output file

Options:

  • -h, --help: show CLI help
  • -v, --version: show CLI version

Example:

$ graphql-json-to-sdl ./schema.json ./schema.graphql

Developing

Install dependencies with:

$ yarn install

To run tests:

$ yarn test

You can also run the CLI in dev mode. For example:

$ ./bin/run --help

Extension points exported contracts — how you extend this code

GraphQLType (Interface)
(no doc)
src/types.ts
GraphQLField (Interface)
(no doc)
src/types.ts
GraphQLInputValue (Interface)
(no doc)
src/types.ts
GraphQLInputField (Interface)
(no doc)
src/types.ts

Core symbols most depended-on inside this repo

run
called by 13
src/index.ts
sortByName
called by 4
src/index.ts
writeSchema
called by 1
src/index.ts

Shape

Function 8
Class 4
Interface 4
Method 1

Languages

TypeScript100%

Modules by API surface

src/index.ts7 symbols
src/index.test.ts6 symbols
src/types.ts4 symbols

For agents

$ claude mcp add graphql-json-to-sdl \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact