0
0
Postmantesting~5 mins

GraphQL body in Postman - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the GraphQL body in a Postman request?
The GraphQL body contains the query or mutation that specifies exactly what data you want to fetch or change from the GraphQL server.
Click to reveal answer
beginner
How do you format a GraphQL body in Postman?
You format it as a JSON object with a "query" field containing your GraphQL query string, and optionally a "variables" field for dynamic values.
Click to reveal answer
beginner
Example of a simple GraphQL query body in Postman?
{ "query": "{ user(id: \"1\") { name email } }" } This fetches the name and email of the user with id 1.
Click to reveal answer
intermediate
Why use variables in a GraphQL body?
Variables let you reuse queries with different inputs without changing the query string, making tests cleaner and easier to maintain.
Click to reveal answer
beginner
What content type should you set in Postman when sending a GraphQL body?
Set the Content-Type header to "application/json" because the GraphQL body is sent as a JSON object.
Click to reveal answer
What key must be included in the JSON body to send a GraphQL query in Postman?
A"query"
B"request"
C"body"
D"data"
How do you include variables in a GraphQL request body?
AIn the HTTP headers
BInside the "query" string directly
CInside the "variables" key as a JSON object
DIn the URL parameters
Which HTTP method is typically used to send a GraphQL body in Postman?
APOST
BGET
CPUT
DDELETE
What Content-Type header should you set for a GraphQL request in Postman?
Atext/plain
Bapplication/json
Capplication/graphql
Dmultipart/form-data
Why is it better to use variables in GraphQL queries?
ATo send queries faster
BTo make the query longer
CTo bypass authentication
DTo avoid repeating the same query with different values
Explain how to structure a GraphQL body in Postman for a query with variables.
Think about how to separate the query and the dynamic data.
You got /3 concepts.
    Describe the steps to test a GraphQL API using Postman.
    Consider what you need to prepare before sending the request.
    You got /5 concepts.