Keploy as a GraphQL testing framework
Keploy tests GraphQL APIs by recording real operations over HTTP and every database or upstream call the resolvers made, then replaying both as assertions. There is no schema to mock, no resolver stub to maintain, and no in-process test server to construct.
keploy record -c "node dist/server.js"What Keploy gives a GraphQL team
Any GraphQL server, unchanged
Keploy records the HTTP transport, so Apollo Server, GraphQL Yoga, Strawberry, graphql-java, and gqlgen all record the same way. Operation name, variables, and the response shape are all captured.
- Apollo, Yoga, Strawberry, gqlgen
- Queries, mutations, and fragments
- Persisted queries supported
- Batched operations captured
Why GraphQL integration tests slow teams down
The friction is rarely the assertions. It is everything around them — spinning up dependencies, keeping mocks honest, and repairing tests after every refactor.
Testing GraphQL: by hand, with Apollo Server testing + mocked schema, or with Keploy
A mocked schema returns type-correct placeholders, so resolvers are the one layer never exercised. Keploy records real operations and every query the resolvers issued.
Select any row for the full comparison, with code.
What you write for GraphQL vs what Keploy records
All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.
The resolver runs, but its data sources are stubs. Field-level resolvers, DataLoader batching, and the actual query count are all invisible.
Instant and schema-accurate — and because the mocks replace the resolvers, this assertion holds even if every resolver is broken.
The mocks list is the query count for one operation, so an N+1 introduced by a new field resolver shows up as extra recorded queries.
Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.
GraphQL testing tools, compared
The options a team on service and platform integrations actually reaches for, and where each one genuinely wins. Select a row for the full comparison.
Assessments reflect each tool’s documented behaviour, not benchmark measurements.
Record your GraphQL app once, replay it forever
Keploy sits below your GraphQL process at the network layer. It watches the calls your app already makes, then serves them back on replay so tests run with no dependencies attached.
Keploy records a GET call to /api/v1/orders/{id} on a GraphQL service and captures the dependency calls it makes.
What Keploy mocks for GraphQL, with zero config
6 of the 7 dependencies a typical GraphQL service talks to are stubbed from the recording itself — no mock classes, no fixture files, no containers in CI.
- Auto-mocked
PostgreSQLView page
Postgres protocol under resolver data sources
- Auto-mocked
MySQLView page
MySQL protocol under resolver data sources
- Auto-mocked
MongoDBView page
Wire protocol under resolver data sources
- Auto-mocked
RedisView page
RESP for resolver caching and DataLoader stores
- Outbound HTTPAuto-mocked
Outbound HTTP
Any REST upstream a resolver calls
- Auto-mocked
gRPCView page
HTTP/2 framed calls from a resolver
- Partial
GraphQL subscriptions
WebSocket transport for live operations
Your first GraphQL test suite in under five minutes
Every command below runs against your existing GraphQL service. Nothing in your source tree changes.
1Install the Keploy CLI
A single binary. It needs a Linux kernel with eBPF support, or Docker on macOS and Windows — and it adds nothing to your project's dependencies.
curl -sSL https://keploy.io/install.sh | bash2Record your service
Pass the command you already use to start the app. Keploy runs it and watches every socket it opens.
keploy record -c "node dist/server.js"3Exercise the paths you care about
Send the operations you care about. Each one becomes a test case with every resolver query it triggered captured alongside.
curl -X POST localhost:4000/graphql -H 'Content-Type: application/json' -d '{"operationName":"ConfirmOrder","query":"mutation ConfirmOrder($id:ID!,$paymentToken:String!){confirmOrder(id:$id,paymentToken:$paymentToken){id state amountMinor}}","variables":{"id":"ord_1","paymentToken":"tok_123"}}'4Replay in CI
Replay serves the recorded dependency responses, so the job needs no service containers and no Docker daemon.
keploy test -c "node dist/server.js" --delay 10
Ready to try it on your own GraphQL service?
Works with the rest of your GraphQL stack
Keploy records at the network layer, so framework and driver choices inside your GraphQL app do not change how it captures traffic.
Node.js
Apollo Server and Yoga record at the HTTP transport.
Python
Strawberry and Graphene record identically.
Go
gqlgen resolvers record with their database calls.
Java
graphql-java and Spring GraphQL record the same way.
PostgreSQL
The database page covers protocol-level capture in depth.
gRPC
Resolver-to-service calls captured as HTTP/2 frames.
Testing the rest of your stack
- Languages
Keploy as a Node.js testing framework
Replace nock registrations and in-memory database fixtures with tests recorded from the traffic your Node service already serves.
Read the guide - Frameworks
Keploy as a NestJS testing framework
Test NestJS controllers through the real HTTP server instead of a Test.createTestingModule graph with every provider mocked.
Read the guide - Databases
Keploy as a PostgreSQL testing framework
Record the Postgres frontend/backend protocol once and replay real result sets in tests — no container, no pg-mem, no schema to rebuild.
Read the guide - Cloud & Infra
Keploy as a gRPC testing framework
Record real gRPC exchanges over HTTP/2 and replay them as tests — no in-process stub server, no hand-written mock service implementation.
Read the guide - Languages
Keploy as a Python testing framework
Turn the requests your Python service already handles into a pytest-grade regression suite, with every dependency mocked from the recording.
Read the guide - Languages
Keploy as a Go testing framework
Record a running Go binary once and get table-test-grade coverage with sqlmock-free database stubs and no httptest servers to maintain.
Read the guide
Join our GlobalCommunity
Connect with developers worldwide. Follow updates, ask questions, share feedback, and ship faster with other Keploy builders.
“Best report of integration and API tests I've seen — which we don't get from RestAssured.”
G2“Future of microservices testing. I don't write tests now!”
G2 · 5/5“An amazing product that simplifies the automation.”
Gartner · 4.0