Mock Apollo Client for Unit Testing

JSON →
library 2.0.0 ·javascript
verified May 27, 2026

Mock Apollo Client is a utility library designed to simplify unit testing of React components that interact with GraphQL APIs via `@apollo/client`. The current stable version is 2.x, which is compatible with `@apollo/client` v4.x. Previous major versions (1.x for Apollo Client v3, and 0.x for Apollo Client v2) exist for backward compatibility. The library helps address limitations found in Apollo Client's built-in `MockedProvider`, such as the inability to assert query/mutation variables, track call counts, dynamically change results after initialization, or easily control loading states. It offers a standalone, framework-agnostic mocking solution that provides granular control over GraphQL operations within tests, making it a powerful alternative for scenarios requiring more advanced testing capabilities than `MockedProvider` offers. Release cadence is tied to major `@apollo/client` updates.

total hits 37
actors 9 distinct systems
last hit 1d ago human
Amazonbot
4
MetaBot
4
GPTBot
2
Script
1
ClaudeBot
1
Search engines
2
Humans
2

top countries 🇨🇦 Canada · 🇺🇸 United States · 🇳🇴 Norway · 🇫🇷 France · BD