API Design
GraphQL Query Request JSON Example
A real-world JSON example of a GraphQL query request body — the query string, variables, and operationName sent to a GraphQL endpoint. Copy-ready for building GraphQL clients and mock servers.
Field Reference
queryrequiredstringThe GraphQL document — one or more operations (query/mutation/subscription) written in GraphQL's own syntax, sent as a plain stringvariablesoptionalobjectValues for the query's $-prefixed variables, keyed by variable name — keeps the query string static and cacheable while data changes per requestoperationNameoptionalstringRequired only when query contains multiple named operations, to specify which one to execute — optional for single-operation documentsVariants
MutationA mutation request follows the identical envelope shape — only the query string's keyword changes.
With FragmentsReusing a field selection across multiple parts of a query via a named fragment.
Common Use Cases
- →Building a lightweight GraphQL client without a full library like Apollo or urql
- →Mocking a GraphQL endpoint's expected request shape for frontend development
- →Debugging why a GraphQL server rejected a request by inspecting the exact query/variables sent
GraphQLqueryrequestAPIvariables
Validate or format this JSON
One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.
Frequently Asked Questions
Related JSON Examples
API DesignGraphQL API ResponseGraphQL response JSON with nested data, cursor pagination, and request extensions.API DesignREST API ResponseGeneric REST API response wrapper with data payload, status, and pagination meta.API DesignPagination ResponsePaginated list response JSON with offset, cursor, total, and navigation links.