0.5.0 • Published 3 years ago
graphql-json-to-sdl v0.5.0
graphql-json-to-sdl
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 OUTArguments:
- 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.graphqlDeveloping
Install dependencies with:
$ yarn installTo run tests:
$ yarn testYou can also run the CLI in dev mode. For example:
$ ./bin/run --help