Odyssey

GraphOS: Basics
deprecated

Getting started with GraphOSProject setupWhat's in a supergraph?Creating a supergraph in GraphOSQueries and the ExplorerSharing your supergraphGraphOS metrics & client awarenessUsing @defer
4. Creating a supergraph in GraphOS
2m

Overview

In this lesson, we'll create a cloud-hosted supergraph in GraphOS! We'll be using GraphOS Studio (the web interface) to get started.

You'll need a GraphOS account with the Serverless plan.

Cloud-hosted supergraphs are currently only available on the Serverless (Free) or Serverless plan. If you created your Studio account or a new organization today, you will automatically have access to this plan.

You can check your organization's current plan in Studio. From your organization's page, go to the Settings tab and scroll down to the Plan and Billing section.

https://studio.apollographql.com

Check your plan

If you are on the legacy Free plan, you will need to convert to the Serverless (Free) plan. Click the Convert to Serverless (Free) button in the top-right corner of your organization's page in Studio.

If you are on the legacy Teams plan, or an Enterprise plan, you won't have access to cloud routing at this time. Create a new organization to continue with the hands-on portions of the course.

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.

Click on the + Create New Graph button on the top right.

https://studio.apollographql.com

Under the Graphs tab, click on the + Create New Graph button

If you see an arrow next to the + Create New Graph button, select the New supergraph option.

Select New supergraph option

Then, follow the rest of the lesson contents.

Step 1: Your GraphQL API

The first thing we need is the endpoint URL of our GraphQL 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 would be a better 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 supergraph!

Hit Next.

Step 2: 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 CANNOT be changed, so let's make sure to pick a good one!

The supergraph name however, you can change at any time. It's displayed throughout Studio and it's usually how you refer to your supergraph with your teammates.

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". The supergraph ID will be named similarly.

Alright, let's hit Create Supergraph.

It'll take just a few moments for GraphOS to provision and host the router for us.... and now we're cooking!

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 a piece of cake! With our supergraph set up, we're ready to start sending it queries!

Previous
Next

Share your questions and comments about this lesson

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.

              supergraph

              A unified, federated graph composed of separate GraphQL APIs using Apollo Federation. Enables a microservices architecture that exposes a unified GraphQL API to clients.

              GraphOS

              A platform for building and managing a supergraph. It provides a management plane to test and ship changes and runtime capabilities to secure and monitor the graph.

              GraphOS Studio

              The web interface for GraphOS, which provides graph, variant, and organization management, metrics visualization, schema pipeline tools and more.

              GraphOS

              A platform for building and managing a supergraph. It provides a management plane to test and ship changes and runtime capabilities to secure and monitor the graph.

              supergraphs

              A unified, federated graph composed of separate GraphQL APIs using Apollo Federation. Enables a microservices architecture that exposes a unified GraphQL API to clients.

              Serverless

              A legacy Apollo plan with both free and paid versions that lets you run a cloud router on shared infrastructure. Intended for developers and teams evaluating GraphOS.

              GraphQL

              An open-source query language and specification for APIs that enables clients to request specific data, promoting efficiency and flexibility in data retrieval.

              subgraph

              A service in a federated GraphQL architecture. Acts as a module for a supergraph. Includes both GraphQL services and REST services integrated via Apollo Connectors.

              subgraphs

              A service in a federated GraphQL architecture. Acts as a module for a supergraph. Includes both GraphQL services and REST services integrated via Apollo Connectors.

              subgraph

              A service in a federated GraphQL architecture. Acts as a module for a supergraph. Includes both GraphQL services and REST services integrated via Apollo Connectors.

              supergraph

              A unified, federated graph composed of separate GraphQL APIs using Apollo Federation. Enables a microservices architecture that exposes a unified GraphQL API to clients.

              supergraph

              A unified, federated graph composed of separate GraphQL APIs using Apollo Federation. Enables a microservices architecture that exposes a unified GraphQL API to clients.

              supergraph

              A unified, federated graph composed of separate GraphQL APIs using Apollo Federation. Enables a microservices architecture that exposes a unified GraphQL API to clients.

              supergraph

              A unified, federated graph composed of separate GraphQL APIs using Apollo Federation. Enables a microservices architecture that exposes a unified GraphQL API to clients.

              supergraph

              A unified, federated graph composed of separate GraphQL APIs using Apollo Federation. Enables a microservices architecture that exposes a unified GraphQL API to clients.

              GraphOS

              A platform for building and managing a supergraph. It provides a management plane to test and ship changes and runtime capabilities to secure and monitor the graph.

              router

              The single access point for a federated GraphQL architecture. It receives incoming operations and intelligently routes them across component services before returning a unified response.

              supergraph

              A unified, federated graph composed of separate GraphQL APIs using Apollo Federation. Enables a microservices architecture that exposes a unified GraphQL API to clients.

              GraphQL

              An open-source query language and specification for APIs that enables clients to request specific data, promoting efficiency and flexibility in data retrieval.

              subgraph

              A service in a federated GraphQL architecture. Acts as a module for a supergraph. Includes both GraphQL services and REST services integrated via Apollo Connectors.

              GraphOS

              A platform for building and managing a supergraph. It provides a management plane to test and ship changes and runtime capabilities to secure and monitor the graph.

              cloud router

              A cloud-hosted, automatically provisioned supergraph routing runtime. Implemented with a fleet of GraphOS Routers and available on Dedicated and Serverless plans.

              subgraph

              A service in a federated GraphQL architecture. Acts as a module for a supergraph. Includes both GraphQL services and REST services integrated via Apollo Connectors.

              supergraph

              A unified, federated graph composed of separate GraphQL APIs using Apollo Federation. Enables a microservices architecture that exposes a unified GraphQL API to clients.

              NEW COURSE ALERT

              Introducing Apollo Connectors

              Connectors are the new and easy way to get started with GraphQL, using existing REST APIs.

              Say goodbye to GraphQL servers and resolvers—now, everything happens in the schema!

              Take the course