In this chapter, we're going to use live and running GraphQL API instead of GraphQL file as the source of truth of your schema. This approach is very useful when you don't deploy on every push and your default branch is fine with temporary breaking changes.
Using GitHub secrets is not possible at the moment but we're working on it!
Single environment setup:
Multiple environment setup:
Whenever possible, GraphQL Inspector introspects a given GraphQL endpoint and compares it with a GraphQL schema of the Pull Request.
Two scenarios to consider here.
- When a Pull Request to
masterbranch is created, GraphQL Inspector introspects a given GraphQL endpoint and compares it with a GraphQL schema of the Pull Request.
- In case when your Pull Request targets to a branch, let's call it
my-random-branchand it's not a branch defined in any of environments, GraphQL Inspector picks schema file as the source of truth.
When using GraphQL Inspector as GitHub Action, endpoint is always as the source of truth.