Graphs and variants
A graph in Apollo Studio represents a connected data graph in your organization. Each graph has one or more variants, which correspond to the different environments where the graph runs (such as staging and production). Each variant has its own GraphQL schema, which means schemas can differ between environments.
To create a graph in Apollo Studio, first select the Studio organization that the graph will belong to. Then click New Graph in the upper right and proceed through the creation flow:
There are two types of graphs in Studio:
- Deployed graphs are shared with other members of your organization. Create a deployed graph for every use case except local development.
- Development graphs (dev graphs for short) are only visible to you. Use them to help you iterate on your graph in your development environment.
You can register your schema to a Studio graph with one of the following methods:
After selecting an organization in Studio, click on a particular graph to view its schema, data, and settings. All of a Studio organization's members can access the data and settings for every graph that belongs to that organization.
Enterprise accounts can set member roles to configure access for individual members of their organization.
Apollo Studio provides a powerful Explorer IDE that helps you visualize your graph and run queries against it. It's available from your graph's Explorer tab in Studio.
The History view in Apollo Studio lets you view the timeline of changes made to your graph's schema:
Only schema changes that you push to Studio are included in this timeline, which is one of the most important reasons to include schema registration in your continuous delivery pipeline.
To distinguish between instances of the same graph running in different environments (such as staging and production), you can define variants for a deployed graph. Each variant has its own schema, along with its own change history, metrics, and operation registry.
Development graphs do not support variants.
To add a variant to your graph, you register a schema to the graph and include a variation name in the registration. If a variation with the specified name doesn't exist yet, Studio creates it.
You can configure Apollo Server to associate the metrics it sends to Apollo Studio with a particular variant. To do so, set the
APOLLO_GRAPH_VARIANT environment variable (
apollo-server pre-2.13.0) to the appropriate variant before initializing Apollo Server.
Make sure you associate metrics with the correct variant! Otherwise, metrics from your staging and test environments will be included in reports for your production graph.
You can transfer a graph to a different Studio organization you belong to by visiting the graph's Settings page and changing the graph owner.
Deleting a graph cannot be undone!
You can delete a graph from Studio by visiting its Settings page and clicking Delete.