Playground API
DocsStatsBlogStudio
Documentation Tree
Technical BlogFeature Deep Dives
  • Introduction
  • Quickstart
    5 min
  • How It Works
  • Recipes & Cookbooks
  • Platform Comparisons
  • Real-World Showcase
  • Interactive Studio
    Studio
  • GraphiQL IDE
    IDE
  • Session Quotas & Activity
  • Network Chaos Simulator
  • Atomic Sandbox Reset
  • Overview & Models
    Hub
  • Users Resource
  • Posts Resource
  • Comments Resource
  • Todos Resource
  • Custom Collections
    Custom
  • Multipart File Uploads
    Upload
  • Dynamic SVG Avatars
    SVG
  • Image Thumbnails
    CDN
  • Relational Filtering
  • Full-Text Search
  • Dynamic Sorting
  • Offset Pagination
  • Cursor Pagination
    Scroll
  • CSV & Excel Export & Import
    IO
  • Custom Collections
    CRUD
  • Overview & Architecture
    Hub
  • JWT Auth Flow
  • Refresh Token Rotation
    Mutex
  • RBAC Permission Matrix
    Roles
  • Expiry Simulation
  • Clock Skew Drift
  • Password Recovery Loop
  • Dual-Mode Sandboxing
  • GraphiQL IDE
    IDE
  • Relational Queries
  • Stateful Mutations
  • Realtime Subscriptions
  • Overview & Flowcharts
    Hub
  • Hosted Checkout
    Stripe
  • Payment Intents API
  • 3DS Challenge Modal
    Modal
  • Customers Vault
  • Charges & Refunds
  • Test Cards Catalog
  • Overview & Channels
    Hub
  • Virtual Email Mailbox
    Mailtrap
  • Virtual SMS Terminal
    Phone
  • In-App Notifications
  • Message Dispatcher
  • Realtime Studio
    Studio
  • Native WebSocket (/ws)
  • Socket.io Gateway
  • Presence & Echo Bot
  • Server-Sent Events (SSE)
    SSE
  • Analytics Telemetry
  • Webhook Subscriptions
  • HMAC SHA-256 Signatures
  • Delivery Logs
  • Manual Retry Simulator
  • Network Latency Delay
  • HTTP Status Codes
  • Rate-Limit Simulator
    429
  • Flaky Network & Jitter
    Chaos
  • Session Quotas & Activity
  • JSON Snapshots
    JSON
  • Headless CI/CD Testing
    CI
  • Mobile QR Code Sync
  • System Metrics & Health
  • Atomic Sandbox Reset
  • Official TypeScript SDK
  • Multi-Language Generators
  • DevTools Extension
  • OpenAPI 3.1 Spec
    JSON
  • Postman Collection v2.1
  • Bruno Collection
  • Insomnia Workspace
  • TypeScript .d.ts
    .d.ts
  • AI Prompt Rules
    Rules
  • Context Index (llms.txt)
  • Full Schema (llms-full.txt)
  • Manifest (product.json)
  • All Feature Articles
    Blog
  • React CRUD Without Backend
    Deep Dive
  • Why Static APIs Fail
  • Mocking Stateful Auth
  • WebSockets & SSE Guide
Technical Blog
Articles

In-depth articles explaining stateful mock APIs, WebSockets, payments, and frontend resilience.

Read Articles
PreviousGraphiQL IDE
NextStateful Mutations
GraphQL Gateway

Relational Queries & Graph Traversal

Fetch relational data models in a single network round-trip. Resolve complex entity links (Users → Posts → Comments → Todos) without experiencing the N+1 problem or payload over-fetching.

Interactive Query Runner

Select a relational pattern below to populate the interactive console and test queries against the live schema:

Execute: Deep Post Graph (Author + Comments)

POST
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

N+1 Problem: REST vs. GraphQL Gateway

How graph query batching reduces latency and bandwidth when retrieving related resource hierarchies:

Traditional REST Architecture (N+1 Calls)
  • 1GET /api/v1/posts?_limit=10 (1 request)
  • 2GET /api/v1/users/:id for each author (10 requests)
  • 3GET /api/v1/posts/:id/comments per post (10 requests)
Total: 21 HTTP round trips • High cellular latency • Redundant headers
Playground GraphQL Gateway (1 Single Call)
  • 1Single POST /api/v1/graphql containing query document.
  • 2Backend resolver fetches author and comments concurrently in memory.
  • 3Exact fields returned: no unused author bio or post body bytes.
Total: 1 HTTP round trip • 75% smaller payload • Zero client waterfall

Supported Query Arguments & Filters

Every collection query in the Playground API schema accepts uniform pagination, sorting, and filter arguments:

ArgumentTypeApplies ToDescription
limit / _limitIntAll collectionsControls the maximum number of items returned (default: 10, max: 100).
page / _pageIntAll collections1-indexed page offset for pagination.
_sort / sortStringAll collectionsSpecifies the field name to order results by (e.g. "title", "id").
_order / orderStringAll collectionsSort direction: "asc" or "desc".
qStringAll collectionsFull-text case-insensitive query searching across strings and text fields.
user_id / userIdIDposts, todosFilters results owned by a specific user author ID.
post_id / postIdIDcommentsFilters comments attached to a specific post thread ID.

Frontend Client Query Recipes

Production-tested data fetching hooks with caching and type safety:

useGraphQLQuery.tsx
1
// Apollo Client useQuery Hook Pattern (React 19 / Next.js)
2
import { useQuery, gql } from '@apollo/client';
3
4
const GET_POSTS_GRAPH = gql
5
query GetPostsGraph($limit: Int) {
6
posts(_limit: $limit) {
7
id
8
title
9
body
10
user {
11
name
12
email
13
}
14
comments {
15
id
16
body
17
}
18
}
19
}
20
;
21
22
export function PostsFeed() {
23
const { data, loading, error, refetch } = useQuery(GET_POSTS_GRAPH, {
24
variables: { limit: 5 },
25
notifyOnNetworkStatusChange: true,
26
});
27
28
if (loading) return <div>Loading relational graph...</div>;
29
if (error) return <div>Query error: {error.message}</div>;
30
31
return (
32
<div>
33
{data?.posts?.map((post: any) => (
34
<article key={post.id}>
35
<h3>{post.title}</h3>
36
<p>By {post.user?.name}</p>
37
<span>{post.comments?.length || 0} comments</span>
38
</article>
39
))}
40
<button onClick={() => refetch()}>Refresh Graph</button>
41
</div>
42
);
43
}