Set up your graph

Transform your REST APIs into a graph with GraphOS


Hello! 👋 These guides teach you to build a graph that incorporates a fictional Ecommerce REST API. A graph lets clients fetch exactly what they need in one request, even across multiple endpoints.

Let's start building!

tip
If you learn best with videos and exercises, this interactive course teaches you how to integrate REST APIs into a graph. Prefer to start with a high-level conceptual understanding? Check out the Apollo Connectors Overview.

Sign into GraphOS

Sign into GraphOS Studio. If you don't have an account yet, sign up for a Free plan at studio.apollographql.com.

Create a graph

  1. When first accessing Studio, you'll see this screen. Follow its instructions to install Rover and authenticate it with GraphOS.

    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. Under Select your starting point, click Connect a REST API.

  1. 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'.
  2. 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