GraphQL Mock Server
Build frontend applications without waiting for backend APIs. Mock any GraphQL schema with queries, mutations, and real-time subscriptions. Works completely offline.
Complete GraphQL Mocking
Everything you need to mock GraphQL APIs for development, testing, and prototyping.
Query & Mutation Mocking
Define mock responses for any GraphQL query or mutation. Return static data or use template variables for dynamic responses.
Subscription Support
Real-time subscription mocking with WebSocket transport. Simulate live data feeds and push notifications.
Schema-First Development
Start with your GraphQL schema and automatically generate mock resolvers. Validate queries against your type definitions.
Custom Resolvers
Write custom resolver logic for complex scenarios. Access request context, variables, and parent data.
Error Simulation
Test error handling with configurable GraphQL errors. Simulate partial failures, validation errors, and network issues.
Introspection Support
Full introspection query support. Works seamlessly with GraphQL Playground, GraphiQL, and IDE plugins.
Schema-First Configuration
Define your GraphQL schema using standard SDL, then configure resolvers with mock data. Use Faker templates for realistic responses and control timing per operation.
- SDL schema: Standard GraphQL Schema Definition Language
- Faker integration: Generate realistic names, emails, and more
- Variable access: Use args, context, and parent in templates
- Subscription intervals: Configure push timing for real-time data
# mockd.yaml - GraphQL Mock Configuration
version: "1.0"
admins:
- name: local
port: 4290
engines:
- name: default
httpPort: 4280
admin: local
workspaces:
- name: default
engines: [default]
mocks:
- id: graphql-api
workspace: default
type: graphql
graphql:
path: /graphql
introspection: true
schema: |
type Query {
user(id: ID!): User
users: [User!]!
}
type Mutation {
createUser(input: CreateUserInput!): User!
}
type Subscription {
postCreated: Post!
}
type User {
id: ID!
name: String!
email: String!
}
type Post {
id: ID!
title: String!
author: User!
}
input CreateUserInput {
name: String!
email: String!
}
resolvers:
Query.user:
response:
id: "1"
name: "Alice Smith"
email: "alice@example.com"
Query.users:
response:
- { id: "1", name: "Alice", email: "alice@example.com" }
- { id: "2", name: "Bob", email: "bob@example.com" }
Mutation.createUser:
response:
id: "{{uuid}}"
name: "New User"
email: "newuser@example.com"
subscriptions:
postCreated:
events:
- data:
id: "{{uuid}}"
title: "New Post"
author: { id: "1", name: "Alice" }
delay: "1s"
timing:
fixedDelay: "5s"
repeat: trueBuilt for Modern Development
From frontend prototyping to integration testing. Mockd accelerates your GraphQL workflow.
Frontend Development
Build React, Vue, or Angular apps without waiting for backend APIs. Iterate on UI with realistic mock data.
GraphQL Client Testing
Test Apollo Client, urql, or Relay applications with predictable responses. Verify caching and error handling.
API Prototyping
Prototype new GraphQL APIs before implementation. Share mock endpoints with stakeholders for feedback.
Schema Validation
Validate schema changes against existing queries. Catch breaking changes before they reach production.
Why Mockd for GraphQL?
Purpose-built for GraphQL development with features that other mock tools lack.
| Feature | Other Tools | Mockd |
|---|---|---|
| Response customization | Limited or hardcoded | Fully configurable per operation |
| Subscription support | Often missing | Full WebSocket subscriptions |
| Schema validation | Manual setup required | Automatic from SDL |
| Error simulation | Basic or none | Rich error scenarios |
| Latency control | Fixed delays | Per-operation timing |
| Introspection | Partial support | Full introspection queries |
Start Mocking GraphQL in Minutes
Single Go binary. No dependencies. Point your GraphQL client and start building.
mockd init && mockd up