Skip to main content
Mock API Builder
Learning Center/Protocols/GraphQL
ProtocolsNew

GraphQL Mock APIs

Import a GraphQL SDL, get mock queries and mutations, and call them at a single project endpoint.

Try it live

Create a GraphQL project

  1. Open New Project.
  2. Click Using GraphQL, gRPC, or SOAP? and select GraphQL.
  3. Name the project and create it. GraphQL projects start empty — you do not define REST fields on the create form.
  4. On the project page, open Import and choose GraphQL (or use the GraphQL import dialog).
  5. Paste your SDL (or upload a .graphql file), preview the operations, and import.

Queries, mutations, and subscriptions in the schema become mock operations. Re-importing updates existing operations for the same fields.

Call the mock

All GraphQL traffic for a project goes to one URL. Send a standard GraphQL HTTP request with a query string (and optional variables):

bash

Successful responses use the usual GraphQL shape:

json

If the project requires an API token, include it the same way as for REST (Bearer token or project API key headers).

Test in the app

On a GraphQL project, the built-in tester opens a GraphQL query panel instead of the REST request builder. Enter a query or mutation, send it, and inspect the data / errors response. Requests are logged like any other mock traffic.

What works today

Supported
  • Queries and mutations over HTTP POST
  • Variables merged into mock responses
  • Field selection on mock data
  • Schema introspection queries
  • Stateful mutations when project state is enabled
Limitations
  • Subscriptions are imported and return mock data over the same HTTP POST endpoint — not live WebSocket streams
  • The project is locked to GraphQL; you cannot add REST routes to the same project

Importing a GraphQL schema into a project already locked to REST (or another protocol) fails with HTTP 409. Create a new GraphQL project instead. See Choosing a Protocol.

Try it

Interactive GraphQL exampleOpen Builder
Previous: Choosing a ProtocolNext: gRPC Mock APIs
Mock API Builder

Built for developers, by developers

DocumentationContactPrivacy PolicyTerms of Service

© 2026 Mock API Builder. All rights reserved.

Double-click for what's new
Learning Center
Learning Center