Odyssey

GraphOS: From Development to Launch

Workshop introFollow-along: GraphOS ExplorerExercise: Explore ExplorerGraphOSExercise: Creating a supergraphFollow-along: Metrics and observabilityFollow-along: Using `@defer`Making changes to the supergraphFollow-along: Schema checks & deployFollow-along: Schema publishExercise: Schema checksWhat's in a supergraph?Exercise: Add a subgraphExercise: Exploring entities & rover devFollow-along: Connecting data with entitiesWhat's next?
14. Exercise: Exploring entities & rover dev
1m

Goal Get familiar with entities in Studio and set up the rover dev experience locally.

Entities

An entity is an object type with fields split between multiple subgraphs. An entity is the building block of a supergraph.

An entity shown with its fields provided by different subgraphs

Which of the following directives are used to define an entity?
In your Poetic Plates supergraph, which of the following types are entities?
For the Recipe entity, which of the following fields below are defined as its key(s)?
For the Appliance entity, which of the following fields below are defined as its key(s)?

rover dev

Runs your supergraph in your local dev environment.

For each subgraph, provide:

  • Subgraph name
  • Where your subgraph is running (locally or remotely)
  • Schema file (optional, can use introspection)

Setting up rover dev

  1. If you stopped the recipes subgraph server at some point, start it again. In a terminal window, in the recipes repo, run:

    Terminal window 1: recipes server
    npm run dev
  2. In a second terminal window, run:

    Terminal window 2: rover dev process 1
    rover dev --name recipes \
    --schema ./schema.graphql \
    --url http://localhost:4001
  3. In your browser, go to http://localhost:4000. You should see a Sandbox environment, where you can query the locally-running router! This is like the cloud router, but running locally.

    At this point, which of the following fields can you query at http://localhost:4000?
  4. In another terminal window, run:

    Terminal window 3: rover dev process 2
    rover dev --name kitchenware \
    --url https://poetic-plates-kitchenware-api.herokuapp.com/
    Which of the following statements about rover dev are true?
  5. Head back to http://localhost:4000 and run the query below to confirm everything is working.

    query GetRandomRecipeAndAllCookware {
    randomRecipe {
    name
    description
    readyTime
    }
    allCookware {
    name
    description
    cleaningInstructions
    }
    }
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.

              entities

              An object type of Apollo Federation that can be fetched with one or more unique keys. Can resolve its fields from multiple data sources in a federated graph.

              object type

              A type in a GraphQL schema that has one or more fields. User is an object type in the following example:

              type User {
              name: String!
              }
              fields

              A unit of data that belongs to a type in a schema. Every GraphQL query requests one or more fields.

              type Author {
              # id, firstName, and lastName are all fields of the Author type
              id: Int!
              firstName: String
              lastName: String
              }
              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.

              entity

              An object type of Apollo Federation that can be fetched with one or more unique keys. Can resolve its fields from multiple data sources in a federated graph.

              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.

              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.

              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.

              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.

              introspection

              A special GraphQL query that enables clients and tools to fetch a GraphQL server's complete schema. Introspection should be disabled in production.

              subgraph server

              A GraphQL server which acts as a module of a supergraph. Subgraph servers can be written in any federation-compatible language or library.

              query

              A request for specific data from a GraphQL server. Clients define the structure of the response, enabling precise and efficient data retrieval.

              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.

              cloud router

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

              query

              A request for specific data from a GraphQL server. Clients define the structure of the response, enabling precise and efficient data retrieval.

              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