API Design
GraphQL API Response JSON Example
A real-world JSON example of a GraphQL API response — including nested data, pagination with cursors, null errors field, and extensions for request tracing. Follows the GraphQL specification response format.
Field Reference
dataobject | nullrequiredThe result of the GraphQL query. null if errors prevented execution.errorsarray | nulloptionalArray of error objects if any field resolution failed. null when successful.extensionsobjectoptionalProtocol extensions: request IDs, tracing, complexity scores.data.user.posts.pageInfoobjectrequiredRelay-style cursor pagination info for the connection.data.user.posts.pageInfo.hasNextPagebooleanrequiredWhether more items exist after endCursor.data.user.posts.edges[].cursorstringrequiredOpaque cursor for this specific edge — used in after: argument.data.user.posts.edges[].nodeobjectrequiredThe actual data object for this edge.Variants
With errorsGraphQL partial response — data for resolved fields, errors for failed ones
Common Use Cases
- →Building GraphQL client code that handles both data and errors correctly
- →Mocking a GraphQL server for frontend development without a backend
- →Understanding Relay-spec cursor-based pagination for infinite scroll
- →Writing integration tests that assert on response shape and field values
- →Documenting your GraphQL API with concrete response examples
GraphQLAPIpaginationcursorresponse formatREST alternative
Validate or format this JSON
Paste the example above into JSONKit's tools to validate, minify, or explore the structure interactively.
Frequently Asked Questions
Related JSON Examples
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.API DesignError ResponseREST API error JSON with status code, machine-readable error code, and validation details.