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.
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
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}}