json2graphql icon indicating copy to clipboard operation
json2graphql copied to clipboard

Help you to convert json to graphql schema effortlessly.

A script to generate graphql schema from json.

Usage

go run main.go -h
NAME:
   inspect - generate a graphql schema based on json

USAGE:
   main [global options] command [command options] [arguments...]

DESCRIPTION:
   inspect json and generate draft schema.graphql

COMMANDS:
     inspect  generate a graphql schema based on json
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --verbose, -v             show logs
   --input value, -i value   the json filename
   --output value, -o value  the target filename to store generated schema
   --help, -h                show help

Example

go run main.go -i example.json

TODO

  • [ ] build it as a web service that render schema on the fly like json.cn
  • [ ] support to read from multi json files.
  • [ ] get input from http request rather than local file.
  • [ ] integrate with graphql server frameworks like gqlgen and auto generate resolver