Right now the diff command only prints out the schema diff and points out breaking/dangerous changes. It would be cool if there was an option like --fail-on-breaking-changes/--fail-on-dangerous-changes to make the tool return with a non-zero exit code. This would be particularly useful in a CI job that compares the schema with the prod environment and should fail if there are any breaking changes.
I'm currently using a bash script to achieve this:
#!/usr/bin/env bash
npm i -g graphql-cli
DIFF=$(graphql diff -e $1 -t $2)
echo "$DIFF"
if [[ $DIFF = *"BREAKING CHANGES"* ]]
then
exit 1
fi
However I think it makes sense to implement this feature into the tool.