When you want to quickly prototype API models in GraphQL SDL.
Sort of like graphqleditor.com, but where the SDL files are on your local machine, where you're using your favorite IDE (not a clunkly SPA web page) to edit/modify GQL Schema SDL files and GraphiQL to navigate reponse types and argumentation in real time as you edit them.
You'll need jq
, a CLI tool for dealing with JSON files.
Configure the folder where the SDL files are located in schema-config.json
.
This will recursively include all .graphqls
files.
The SDL files can be anywhere on the host machine; they do not need to be in this project.
Default server port is 4002
. Set it here if other things need that port.
{
"serverPort": 4321,
"schemaRootFolder": "/Users/you/projects/super-secret/schema"
}
Fire up the nanobots.
$ yarn install
$ yarn start
Use any GQL schema browser to inspect the API models at http://localhost:4002
. I recommend GraphiQL.
- Using GraphiQL, MacOS didn't trust the developer. I had to go to Finder, right click on GraphiQL, click 'Open', then trust it.
- From there it wasn't an issue
Other candidates include:
- Apollo GraphQL Explorer
- GraphQL Playground
- Voyager
- Not bad, but I have to assemble the entire group of files and paste them on the screen. No thanks.
- ETC