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.
Recipe
entity, which of the following fields below are defined as its key(s)?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
If you stopped the
recipes
subgraph server at some point, start it again. In a terminal window, in therecipes
repo, run:Terminal window 1: recipes servernpm run devIn a second terminal window, run:
Terminal window 2: rover dev process 1rover dev --name recipes \--schema ./schema.graphql \--url http://localhost:4001In 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?In another terminal window, run:
Terminal window 3: rover dev process 2rover dev --name kitchenware \--url https://poetic-plates-kitchenware-api.herokuapp.com/Which of the following statements aboutrover dev
are true?Head back to http://localhost:4000 and run the query below to confirm everything is working.
query GetRandomRecipeAndAllCookware {randomRecipe {namedescriptionreadyTime}allCookware {namedescriptioncleaningInstructions}}
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.