🔪🥒 Swiss Army Knife for your GraphQL Project
- Helpful commands to improve your workflows like
get-schema
,diff
&playground
- Compatible with editors and IDEs based on
graphql-config
- Powerful plugin system to extend
graphql-cli
with custom commands
You can see it in action here:
You can simply install the CLI using npm
or yarn
by running the following command. This will add the graphql
(and shorter gql
) binary to your path.
npm install -g graphql-cli
Usage: graphql [command]
Commands:
init Initial config setup
add-endpoint Add new endpoint to .graphqlconfig
get-schema [endpoint] Download schema from endpoint
schema-status Show source and timestamp of the local schema file
ping [endpointName] Ping GraphQL endpoint
diff <from> [to] Show a diff between two schemas
playground [endpoint] Open interactive GraphQL Playground
Options:
--help Show help [boolean]
Examples:
graphql init Interactively setup .graphqlconfig file
graphql get-schema dev Update local schema to match "dev" endpoint
graphql diff dev prod Show schema diff between "dev" and "prod" endpoints
For more information go to https://github.com/graphcool/graphcool-cli
To install autocompletion in your terminal run
graphql completion >> ~/.bashrc
or on OSX
graphql completion >> ~/.bash_profile
graphql-cli-voyager
- Open graphql-voyager in your browsergraphql-cli-faker
(coming soon) - Run a fake server based on your schema using graphql-fakergraphql-cli-codegen
- Generates type annotation from your GraphQL queries usingapollo-codegen
.
Do you want to create your own plugin? Here is a simple example.
A big thank you to all contributors and supporters of this repository 💚
Join our Slack community if you run into issues or have questions. We love talking to you!