In this lesson, we'll create a cloud-hosted supergraph in GraphOS! We'll be focusing on using Apollo Studio (the web interface) to get started.
You'll need a Studio account with the Serverless plan.
Create a new supergraph
If this is your first time on Studio, then you'll see a page that looks like this:
Click on the Connect your GraphQL API button.
Step 1: Your GraphQL API
The first thing we need is the endpoint URL of our GraphQL API. That's the Poetic Plates API! Let's paste it in.
Next, the subgraph name. It should be clear and simple. We could name it "Poetic Plates", the same name we've been calling our API so far. But subgraphs are usually focused on a specific business domain, and this one is focused on content about recipes, so that seems like a good name to use!
Remember, this will become the first subgraph of our supergraph!
Hit Next to move to the next step.
Step 2: Supergraph
On to the supergraph. On this step, we'll pick a short ID and a name for our supergraph.
The supergraph ID will be used to reference your supergraph from various tools later on. It can't be changed, so let's make sure to pick a good one!
The supergraph name is displayed throughout Studio and usually how you refer to your supergraph with your teammates. You can change it at any time.
In our case, we're going to go with the name "Poetic Plates". That's how we've been referring to our API since the beginning!
The supergraph ID will be named similarly.
We're happy with our naming choices so we'll hit Create Supergraph.
We'll wait for GraphOS to provision and host the router for us, which should only take a few moments... and hooray! 🎉
Just like that, our supergraph is ready to query!
- To create a supergraph, you need your GraphQL API endpoint. This becomes the first subgraph of your supergraph.
- GraphOS takes care of provisioning and hosting the cloud router for you.
- We recommend keeping subgraph names clear and simple. Each should describe the domain it's focused on.
That was quick and easy! We've got our supergraph set up and we're ready to start sending it queries!
Share your questions and comments about this lesson
This course is currently in
You'll need a GitHub account to post below. Don't have one? Post in our Odyssey forum instead.