Apollo Studio CI/CD
Steps to configure CI/CD for GraphQL Schema in Apollo studio
Create API Key
Open your graph explorer.
Click on the gear icon on the left pane.
Goto This graph tab
Click on API Keys -> Create New Key -> Choose Name -> Create Copy API Key
Install rover
rover is a cli tool to interact with Apollo Studio.
Run the below command to install rover:
Authentication:
To use the rover tool to interact with your apollo studio project, you need to authenticate, to do that you need to set APOLLO_KEY
environment variable in the bash.
Schema Checks
You can optionally run the below command to check for any improper changes that could negatively impact existing clients.
GRAPHQL REF
: it would be in the format name@variant (you can find this by clicking on the subgraphs tab in the left panel at the header you can see something likeSubgraphs for x@y
, where x is name, and y is variant )SUBGRAPH Name
: You can find this at subgraphs tab -> Name headerSCHEMA Path
: This is the local path of the schema
You can refer to the Overall sample command below:
Publish Schema
To update the existing subgraph with the new schema, you can use the below command:
GRAPHQL Endpoint
: The url for your graphql API, apollo studio explorer will use this while calling the API.
You can refer to the Overall sample command below:
Last updated