Apollo
Apollo Client is the full-featured GraphQL client: declarative queries and mutations, a normalized cache, fragments, subscriptions, and a configurable link chain. Its cache is both what makes it powerful and what interview questions concentrate on.
on this pageshowhide
explore
- Queries and Mutations6 questions
- Normalized Cache5 questions
- Fragments5 questions
- Subscriptions6 questions
- Local State and Reactive Vars5 questions
- Links and Error Handling6 questions
questions
page 2 of 2In Apollo Client 4, an isInCart @client field computed by a LocalState resolver shows stale values after the cart changes, while a read-function version stays current; why?
basics
~20 sA LocalState resolver runs when the operation executes, and its output is cached with the server result, so cache-first reads return the stored value. A read function computes the field on read and tracks the reactive variables it reads.
Upgrading an issue-detail component from Apollo Client 3 to 4, what must change in a useQuery call that imports from @apollo/client and uses skip and onCompleted?
basics
~20 sIn Apollo Client 4, import useQuery from @apollo/client/react and move onCompleted logic into render or an effect on data, because query hooks lost that callback. Replace skip with skipToken, deprecated since 4.3, and expect loading during refetch.
When would you run Apollo Client 4 subscriptions as multipart HTTP through HttpLink instead of a GraphQLWsLink WebSocket, and what does it cost?
basics
~20 sWhen the server supports multipart subscriptions, HttpLink streams them with no extra library, split or connectionParams, reusing the HTTP auth headers. The cost is one long-lived HTTP response per subscription, a one-way channel, and a server that must implement the protocol.
showing 31–33 of 33