3. Creating a supergraph in GraphOS
2m

Overview

In this lesson, we'll create a cloud-hosted in ! 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:

https://studio.apollographql.com

Welcome page for creating a supergraph

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.

Endpoint URL
https://poetic-plates-recipes-api.herokuapp.com/

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!

Subgraph name
recipes
https://studio.apollographql.com

Step 1 of supergraph creation with the URL and name filled out

Remember, this will become the first subgraph of our !

Hit Next to move to the next step.

Step 2: Supergraph

On to the . On this step, we'll pick a short ID and a name for our .

The ID will be used to reference your from various tools later on. It can't be changed, so let's make sure to pick a good one!

The name is displayed throughout Studio and usually how you refer to your with your teammates. You can change it at any time.

https://studio.apollographql.com

Step 2 of supergraph creation with the ID and name filled out

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 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 is ready to query!

https://studio.apollographql.com

Modal shows that the supergraph is ready to query

Task!

Key takeaways

  • 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.

Up next

That was quick and easy! We've got our set up and we're ready to start sending it queries!

Previous
Next

Share your questions and comments about this lesson

This course is currently in

beta
. Your feedback helps us improve! If you're stuck or confused, let us know and we'll help you out. All comments are public and must follow the Apollo Code of Conduct. Note that comments that have been resolved or addressed may be removed.

You'll need a GitHub account to post below. Don't have one? Post in our Odyssey forum instead.