4. Creating a supergraph in GraphOS2m

Overview

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:

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 Space Courses API! Let's paste it in.

Endpoint URL
https://space-courses-api.herokuapp.com/

Next, the subgraph name. This API is all about learning materials for our catstronauts-in-training, so we'll call this subgraph space-courses.

Subgraph name
space-courses
https://studio.apollographql.com

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

This is going to be the first subgraph of our supergraph.

Hit Next to move to the next step.

Step 2: Supergraph

Let's 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 make sure you 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 any time.

https://studio.apollographql.com

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

When you're happy with your choices, 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!

https://studio.apollographql.com

Modal shows that the supergraph is ready to query

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.

Up next

We'll start sending queries to our supergraph!

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. Note that all comments are public and must follow the Apollo Code of Conduct.