Recall & Review
beginner
What is Apollo Client used for in a GraphQL application?
Apollo Client is a tool that helps your app talk to a GraphQL server. It fetches data, manages it locally, and updates your app when data changes.
Click to reveal answer
beginner
Which package do you install to use Apollo Client in a JavaScript project?
You install the
@apollo/client package to use Apollo Client in your JavaScript or React project.Click to reveal answer
beginner
What is the purpose of
ApolloProvider in Apollo Client setup?ApolloProvider wraps your app and makes the Apollo Client available to all components so they can run GraphQL queries and mutations.Click to reveal answer
intermediate
What is the role of
InMemoryCache in Apollo Client?InMemoryCache stores the data fetched from the GraphQL server locally in memory. It helps Apollo Client manage and reuse data efficiently.Click to reveal answer
beginner
How do you specify the GraphQL server URL in Apollo Client setup?
You provide the server URL in the
uri option when creating an ApolloClient instance, like new ApolloClient({ uri: 'https://your-server.com/graphql' }).Click to reveal answer
Which of these is the correct package to install for Apollo Client?
✗ Incorrect
The correct package for Apollo Client in frontend apps is
@apollo/client. Others are for server or unrelated.What does
InMemoryCache do in Apollo Client?✗ Incorrect
InMemoryCache keeps fetched data in memory so Apollo Client can reuse it without asking the server again.What component wraps your React app to provide Apollo Client functionality?
✗ Incorrect
ApolloProvider is the official component that makes Apollo Client available to your React components.Where do you specify the GraphQL server URL in Apollo Client?
✗ Incorrect
The server URL is set in the
uri option when you create the ApolloClient instance.Which of these is NOT part of the basic Apollo Client setup?
✗ Incorrect
Writing server resolvers is done on the backend, not part of the Apollo Client setup on the frontend.
Describe the steps to set up Apollo Client in a React app from installation to making it available in components.
Think about what you need to install, create, and wrap.
You got /3 concepts.
Explain the role of InMemoryCache in Apollo Client and why it is important.
Consider how caching helps your app work faster.
You got /3 concepts.