graphql-json-to-sdl
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i graphql-json-to-sdl

Weekly Downloads

1,908

Version

0.5.0

License

MIT

Unpacked Size

14 kB

Total Files

11

Last publish

Collaborators

  • cdthomas