GraphQL Inspector can be used with any Continuous Integration. It's easy!
GraphQL Inspector already has CLI but we developed a more suited approach for consuming it in CI/CD. It's called CLI for CI.
Most common use case is schema diffing and all the other features are never touched. That's why we decide to make each feature pluggable.
In GraphQLI Inspector CLI for CI, you're able to install exactly what you want to use. Each command is an installable package.
Here's a list of available command. Pick one or few.
"Loader" is a fairly new concept. Since each command is a package, we decided to do the same for schema/document loading logic.
Depending on the source of GraphQL Schema or GraphQL Documents, pick one or few from the list.
|introspection result |
|File in Git repository|
|File on GitHub|
Now you know where everything is but let's find out how to make a use of it.
Let's take for example Schema Diffing and assume your latest
schema.graphql is under
You want to compare two GraphQL Schemas:
You need to be able to load
schema.graphql from disk and from
origin/master on Git:
With everything installed, you can use the command below in your CI setup:
Now, when you push your changes you would see the following:
Remember, you can use any command the CLI offers.
We recommend to automate the workflow and use
husky to run
$ graphql-inspector introspect.
This way you
schema.graphql is always in sync with the code, on each commit.
Using Docker image
You can use GraphQL Inspector Docker image in any CI/CD provider. For example, in CircleCI it would look like this: