Choose the best response for each question. Then select Check your answers.
How would you create a page in a Gatsby app?
Create a React component in the pages directory.
Create a component anywhere in your project. Gatsby will scan the directory for React components.
Create a component with the Page prefix in its component name.
Create a Markdown file and place it in the pages directory.
How would you set up a route for a page component?
You wouldn't. Gatsby does this for you.
Set up the route by implementing the Gatsby API in the file gatsby-node.js.
Create an App.js entry component and within it a Route component and resolver component for each route.
Create a React component in the pages directory and call the registerRoute() method, passing the route as a string together with the component.
How would you use data from the in-memory data graph in your page component?
Construct a page component and define a variable query that contains a GraphQL query. Then render the query response in the component.
Do a fetch request and render the response in the component.
Use Gatsby's Data component, set the query property to your query and render your Page component in its render property.
Use the function useData() and pass it your query as a parameter. It will return an object with a property data that contains your GraphQL response.
What pre-steps would you need to take to deploy a Gatsby app using the Azure Static Web Apps service?
Initialize a Git repo, build the project, and push it to GitHub
Initialize a Git repo and push it to GitHub
Run gatsby build to create a deployable directory. Compress the resulting build directory into a tarball. The tarball can now be uploaded to Azure Static Web Apps service.
Run gatsby deploy. This will create a binary that you can deploy to Azure Static Web Apps service.
You must answer all questions before checking your work.
Need help? See our troubleshooting guide or provide specific feedback by reporting an issue.