Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
# GraphQL query — ask only for the fields you need query GetUser { user(id: "1") { id name email posts { title publishedAt } } } # Equivalent REST would require two calls: # GET /users/1 # GET /users/1/posts # GraphQL response mirrors the query shape: # { # "data": { # "user": { # "id": "1", # "name": "Alice", # "email": "alice@example.com", # "posts": [ # { "title": "Hello World", "publishedAt": "2024-01-15" } # ] # } # } # } # All requests go to one endpoint: # POST https://api.example.com/graphql
Result
Open