Test your GraphQL resolvers under pressure
GraphQL Load Testing
Send realistic GraphQL queries and mutations at scale. Use response measurements alongside server traces to investigate slow resolvers, N+1 queries and connection-pool limits.
Standalone k6 example
Adapt this script and run it with k6 against an approved target. loadtest.dev accepts declarative GET/HEAD plans; it does not execute these scripts.
Queries, mutations, and subscriptions
Variable parameterization
Authentication header injection
Per-operation latency tracking
Complexity-based testing scenarios
Works with Apollo, Hasura, and any GraphQL server
graphql-test.js
import http from 'k6/http';
import { check } from 'k6';
export const options = { vus: 50, duration: '3m' };
const query = `
query GetProducts($limit: Int!) {
products(limit: $limit) {
id
name
price
reviews { rating }
}
}
`;
export default function () {
const res = http.post('https://api.example.com/graphql',
JSON.stringify({ query, variables: { limit: 20 } }),
{ headers: { 'Content-Type': 'application/json' } }
);
check(res, {
'status 200': (r) => r.status === 200,
'no errors': (r) => !JSON.parse(r.body).errors,
});
}Frequently asked questions
Related guides
API Load Testing
Learn how to test HTTP APIs with standalone k6 scripts, measure latency and failed requests, and choose rates suited to your approved target.
Use an HTTP plan with loadtest.dev
For estate apps, declare GET/HEAD requests to a verified hostname and submit a plan through the authenticated API.