As part of our build pipeline we wanted to use GraphQL Inspector to check if our updated GraphQL schema contained any breaking changes.
GraphQL Inspector is available as a commandline tool and can be installed through NPM.
So the first step was to use the NPM task to install the tool:
But now the question is how can we invoke the installed tool?
This is possible thanks to NPX. NPX stands for Node Package Execute and it comes with NPM. It is an npm package runner that can execute any package that you want from the npm registry.
I added a command line task to invoke npx:
Remark: When using NPX you even don’t need to install the package first. This means that the NPM task I created first is not necessary.