GraphQL Client
Execute GraphQL Query or Mutation.
Sends one GraphQL query or mutation as an HTTP POST to the endpoint of a credential and returns data, or the GraphQL errors through the error port.
How it works
- Resolves the config.
connection_id,queryandvariablesfall back to the same keys of the incoming payload;connection_idandqueryare required. - Resolves the credential. The endpoint is
config.url(orconfig.endpoint); extra headers come fromconfig.headers. - Adds authentication from the secret, first match wins:
token→Authorization: Bearer,apiKey→ headerconfig.headerName(defaultx-api-key),username+password→Authorization: Basic. - POSTs
{ query, variables }as JSON. - If the response has a non-empty
errorsarray, leaves througherrorwith{ errors }; otherwise returns{ data }throughout.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-fetch-order",
"label": "Fetch order",
"operator_slug": "io.graphql",
"operator_version": "1.0.0",
"config": {
"connection_id": "pi-credential-xxxx",
"query": "query Order($id: ID!) { order(id: $id) { id status } }",
"variables": {
"id": "{{ $json.order_id }}"
}
}
}{
"ok": true,
"data": {
"data": {
"order": {
"id": "ord_123",
"status": "PAID"
}
}
},
"port": "out"
}Configuration
-
connection_idstring Required -
Credential for the GraphQL endpoint. Accepts credentials of type `api-key`, `basic-auth`, or `oauth2` (bearer token).
-
querystring Required -
GraphQL Query/Mutation
-
variablesobject Optional
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
connection_id - Accepts
basic-auth,oauth2andobjectcredentials whose secret is an object withtoken,apiKeyorusername+password. Anapi-keycredential stored as a plain string adds no header. A value starting withhttpis used as the endpoint URL itself, without authentication. -
variables - Sent as-is; expressions inside are resolved first.
Output ports
out default The server answered 2xx without GraphQL errors. data is the data field of the GraphQL response.
{
"data": {
"order": {
"id": "ord_123",
"status": "PAID"
}
}
}error The response carries GraphQL errors (data is { errors }), or the request failed (data is { error, response }, with response the body of a non-2xx answer).
{
"errors": [
{
"message": "Cannot query field \"stat\" on type \"Order\".",
"locations": [
{
"line": 1,
"column": 32
}
]
}
]
}In expressions
What a later node can read from this node's output with $("GraphQL Client").item.json.<path> (write your node's label instead of GraphQL Client). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("GraphQL Client").item.json.dataGraphQL Data | ||
$("GraphQL Client").item.json.errorsGraphQL Errors | — | |
$("GraphQL Client").item.json.data.order | — |
— Editor: The editor suggests it, but the worker does not return it: it reads as undefined.
— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).
Errors
| Message | Port | Cause and fix |
|---|---|---|
connection_id is required | error | No credential selected. Pick a GraphQL credential. |
query is required | error | The query is empty in the config and in the incoming payload. |
Request failed with status code <status> | error | The server answered non-2xx. response holds its body. Check the endpoint and the authentication. |
Failed to resolve connection <connection_id>: <detail> | error | The credential does not exist or this workflow cannot use it. |
Input contract
-
connection_idstring Required -
querystring Required -
variablesobject Optional
Output contract
-
dataobject Optional -
GraphQL Data
-
errorsarray Optional -
GraphQL Errors
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "io.graphql",
"name": "GraphQL Client",
"category": "io",
"version": "1.0.0",
"description": "Execute GraphQL Query or Mutation.",
"capabilities": [
"graphql",
"api",
"http"
],
"config_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "GraphQL Credential",
"description": "Credential for the GraphQL endpoint. Accepts credentials of type `api-key`, `basic-auth`, or `oauth2` (bearer token).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"api-key",
"basic-auth",
"oauth2"
],
"types": [
"graphql",
"http"
]
}
},
"query": {
"type": "string",
"description": "GraphQL Query/Mutation"
},
"variables": {
"type": "object"
}
},
"required": [
"connection_id",
"query"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"query": {
"type": "string"
},
"variables": {
"type": "object"
}
},
"required": [
"connection_id",
"query"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"data": {
"type": "object",
"description": "GraphQL Data"
},
"errors": {
"type": "array",
"description": "GraphQL Errors"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Data",
"description": "GraphQL data response",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Errors",
"description": "GraphQL errors or network error",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "async",
"required_resources": [],
"compatible_worker_pools": [
"standard-io"
],
"tags": [
"graphql",
"api"
],
"is_stateful": false,
"publisher": {
"identity": "org_link_loom",
"profile": {
"name": "Link Loom",
"verified": true,
"url": "https://me.veripass.com/link-loom",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string",
"title": "GraphQL Credential",
"description": "Credential for the GraphQL endpoint. Accepts credentials of type `api-key`, `basic-auth`, or `oauth2` (bearer token).",
"ui_widget": "connection_picker",
"ui_options": {
"credential_types": [
"api-key",
"basic-auth",
"oauth2"
],
"types": [
"graphql",
"http"
]
}
},
"query": {
"type": "string",
"description": "GraphQL Query/Mutation"
},
"variables": {
"type": "object"
}
},
"required": [
"connection_id",
"query"
]
}{
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"query": {
"type": "string"
},
"variables": {
"type": "object"
}
},
"required": [
"connection_id",
"query"
]
}{
"type": "object",
"properties": {
"data": {
"type": "object",
"description": "GraphQL Data"
},
"errors": {
"type": "array",
"description": "GraphQL Errors"
}
}
}[
{
"port_id": "out",
"label": "Data",
"description": "GraphQL data response",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Errors",
"description": "GraphQL errors or network error",
"is_default": false,
"supports_condition": false
}
]Execution
- Execution
async- Stateful
- No
- Credentials
- Resolved on the server from
connection_id; the secret never reaches the workflow. - Capabilities
graphqlapihttp- Tags
graphqlapi
Notes and limits
- A response with both
dataanderrors(partial success) goes toerrorand the partialdatais dropped. - No request timeout and no retries are applied.
Reviewed against the orchestrator code · 31e874b · 2026-11-26