Set up your graph

Transform your REST APIs into a graph with GraphOS


Hello! 👋 This set of guides gets you up and running with a graph built on REST APIs.

A graph is network of interconnected data that enables clients to traverse relationships and fetch exactly what they need in a single request.

In this and the following guides, you will:

  • Set up a graph

  • Learn how to use Apollo's tools like GraphOS Studio, Rover CLI and Apollo Sandbox

Let's start building!

tip
If you learn best with videos and exercises, this interactive course teaches you how to bring an existing REST API into a graph using Apollo Connectors. It covers the same essentials as this guide, but goes into more detail and has additional sections, like how to use connectors to make POST requests.

Prefer to start with a high-level conceptual understanding? Check out the Apollo Connectors Overview.

🧰 Meet your tools

Throughout this guide you'll be using the following Apollo tools:

  • GraphOS Studio is the primary web interface for GraphOS. Studio helps you monitor, manage, and collaborate on your GraphQL APIs.

  • The Rover CLI is the primary command-line interface for GraphOS.

None of these tools requires a paid plan.

Create a GraphOS account

note
Skip to the next section if you already have a GraphOS account.

You need an account to work with GraphOS. Sign up for a Free plan at studio.apollographql.com.

Create a graph

  1. If your organization hasn't created any graphs in Studio yet, Studio presents the following screen that encourages you to get started with the Rover CLI. Follow the instructions on the screen to install Rover and authenticate it with your GraphOS account. Then, under Select your starting point, click Connect a REST API.

    GraphOS Studio when an organization hasn't created any graphs. The screen prompts users to install the Rover CLI, connect it to GraphOS, and select a starting point: either a REST or GraphQL API.
  2. If you already have existing graphs, you won't see this screen, but it's still helpful to start by installing Rover with the appropriate command for your system:

    terminal
    MacOS / Unix-like
    curl -sSL https://rover.apollo.dev/nix/latest | sh	
    terminal
    Windows
    iwr 'https://rover.apollo.dev/win/latest' | iex	

    Then, click Add new graph on the upper right of the Studio homepage and select Connect a REST API.

    GraphOS Studio when an organization has one more graphs.
  3. Enter a graph title and graph ID and keep the defaults for the other form elements. Then click Create and continue.

    A form titled 'Connect a REST API'.
The 'Graph title' field has the value 'Ecomm Example'.
The 'Graph ID' field has the value 'Ecomm-Example'.
There is a button which says 'Create and continue'.
  4. Next, follow the instructions to set up your local development environment. You should end up with a supergraph.yaml and products.graphql file in your local project.

    File overview
    • The supergraph.yaml specifies which Apollo Federation version to use and configures your subgraphs, the different services that make up your supergraph.
    • The products.graphql contains a GraphQL schema and defines your graph's structure, types, and capabilities. The schema is where you define Connectors and where this guide spends most of its time.

    Once rover dev is running, your terminal should look something like this:

    terminal
    supergraph config loaded successfully
    warning: Do not run this command in production! It is intended for local development only.
    ==> Watching products.graphql for changes
    WARN: Connector debugging is enabled, this may expose sensitive information.
    ==> your supergraph is running! head to http://localhost:4000 to query your supergraph
    successfully composed with version 2.10.0

    The last step in the modal brings you back to this quickstart guide.

🎉 Congratulations—you've successfully started a local development session where you can explore, develop, and publish updates to your graph!

Next steps

Here's where the fun begins. Jump over to the next guide to start developing your graph.

Feedback

Forums