Recall & Review
beginner
What is Apollo Server used for?
Apollo Server is a tool that helps you create a GraphQL API easily. It listens for requests and sends back data based on your schema and resolvers.
Click to reveal answer
beginner
Which two main parts do you need to define when setting up Apollo Server?
You need to define the type definitions (schema) and the resolvers (functions that fetch data).
Click to reveal answer
beginner
What is the purpose of the
typeDefs in Apollo Server?typeDefs define the shape of your data and the queries or mutations clients can make. Think of it as a contract between client and server.Click to reveal answer
beginner
How do you start Apollo Server to listen for requests?
You call the
listen() method on the Apollo Server instance. It starts the server and waits for client requests.Click to reveal answer
beginner
What is a resolver in Apollo Server?
A resolver is a function that tells Apollo Server how to get the data for a specific field in your schema. It connects the schema to your data sources.
Click to reveal answer
What do you need to provide to Apollo Server to define your API's data structure?
✗ Incorrect
typeDefs define the data structure and queries in Apollo Server.
Which method starts the Apollo Server to listen for incoming requests?
✗ Incorrect
The listen() method starts the server and waits for requests.
What role do resolvers play in Apollo Server?
✗ Incorrect
Resolvers fetch or compute the data for each field in the schema.
Which of the following is NOT required to set up a basic Apollo Server?
✗ Incorrect
A database connection is optional; Apollo Server can serve static data or other sources.
Apollo Server is primarily used to build what kind of API?
✗ Incorrect
Apollo Server is designed to build GraphQL APIs.
Explain the basic steps to set up Apollo Server from scratch.
Think about what you need to tell Apollo Server about your data and how to start it.
You got /4 concepts.
Describe the roles of typeDefs and resolvers in Apollo Server.
One defines the shape, the other provides the content.
You got /4 concepts.