0
0
GraphQLquery~5 mins

Apollo Server setup in GraphQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
AtypeDefs
BResolvers
CMiddleware
DDatabase connection
Which method starts the Apollo Server to listen for incoming requests?
Alisten()
Bstart()
Crun()
Dexecute()
What role do resolvers play in Apollo Server?
ADefine the schema
BFetch data for schema fields
CHandle server errors
DManage user authentication
Which of the following is NOT required to set up a basic Apollo Server?
AtypeDefs
BResolvers
CDatabase connection
DServer listen method
Apollo Server is primarily used to build what kind of API?
AFile API
BREST API
CSOAP API
DGraphQL API
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.