GraphQL
GraphQL requests have their own editor — Query, Variables, Operation name, Headers, Auth — and send through the ordinary toolbar.
Underneath, the engine executes them as an HTTP POST. That is not a limitation to work
around; it is why GraphQL gets auth injection, {{variable}} resolution, the cookie jar,
gateway rewriting, tests, and history without any of it being reimplemented.
Author one
Section titled “Author one”- Create a request with protocol GraphQL.
- Set the endpoint URL.
- Write the query or mutation in the Query tab.
- Put variables in the Variables tab as a JSON object.
- Set Operation name when the document contains more than one operation.
query GetUser($id: ID!) { user(id: $id) { id email roles }}{ "id": "{{userId}}" }{{variables}} resolve inside the query text and inside the variables JSON, so "{{userId}}"
above is filled from the active environment at send time.
Responses
Section titled “Responses”The response renders in the normal response pane — same JSON folding, same click-to-copy, same Tests tab.
Remember that GraphQL reports errors in the body with HTTP 200. A test asserting
status eq 200 will pass on a failed query. Assert on the payload instead:
tests: - source: body path: data.user.id op: exists - source: body path: errors op: ne expected: ""Chains
Section titled “Chains”GraphQL requests are chainable — they produce exactly one response. Extract from the body with a dotted path as usual:
extract: - var: userId from: body path: data.user.idNot in this release
Section titled “Not in this release”- Subscriptions. GraphQL over WebSocket is not supported. For a raw socket, use the WebSocket protocol directly.
- Introspection. The editor does not fetch the schema, so there is no schema-aware completion for GraphQL. Spec-aware completion in the Editor view comes from bound OpenAPI documents.
In the file format
Section titled “In the file format”- name: Get user protocol: graphql method: POST url: "{{baseUrl}}/graphql" graphql: query: | query GetUser($id: ID!) { user(id: $id) { id email } } variables: '{"id":"{{userId}}"}' operationName: GetUser auth: provider: users-apivariables is a JSON-encoded string, not a nested mapping.