Skill Zuno · skillzunos.com · Fullstack Pro
React Graphql interview questions
Prepare for React Graphql interviews on Skill Zuno. This practice book covers React Graphql interview questions across New, Easy, Medium, Hard, and Diff levels so you can work through real interview-style problems on skillzunos.com.
Open React Graphql on Skill ZunoAlso see the React Graphql tutorial.
React GraphQL covers consuming GraphQL APIs in React applications with clients such as Apollo Client, urql and Relay. Hooks such as useQuery and useMutation fetch data declaratively, and a normalised cache keeps every component in sync. Interviews cover client setup, queries and mutations with hooks, cache updates and optimistic UI, pagination, fragments and generated types.
Sample React Graphql interview questions
What does useQuery return?
An object with loading, error and data, plus helpers such as refetch and fetchMore. The component re-renders when the query's cached data changes.
What is optimistic UI in Apollo?
Passing an optimisticResponse to a mutation so the cache, and therefore the UI, updates immediately as if the server had succeeded. If the server fails, Apollo rolls the change back.
Why use fragments in React components?
Each component declares exactly the fields it needs as a fragment, and parents compose them into one query. This colocates data requirements with UI and avoids over-fetching.
How is Relay different from Apollo Client?
Relay is stricter: it compiles queries at build time, requires fragments and a connection spec for pagination, and enforces data masking. Apollo is more flexible and easier to adopt.
When should you update the cache manually after a mutation?
When the mutation creates or deletes items, because Apollo cannot know which lists to change. Use the update function with cache.modify, or refetch the affected queries.
What you can practice
- React Graphql interview questions for beginners and experienced developers
- Level-based practice: New, Easy, Medium, Hard, and Diff
- Fullstack Pro topics alongside React Graphql on skillzunos.com