GraphQL

GraphQL is a query language for APIs that provides a more efficient and flexible alternative to REST. It allows clients to request only the data they need and nothing more, streamlining interactions between the client and server. This results in potentially reduced traffic and server load.

Do a GraphQL transaction

Using the request function, you can do a transaction on an existing GraphQL API.

There are multiple parameters at play for this request:

ParameterTypeDefaultDescription

url

String

The GraphQL API endpoint.

document

String

Your GraphQL request. Either a query or a mutation in GraphQL notation.

variables

Object

Optionally provide variables with this parameter.

headers

Object

Any header key-value pairs (e.g. for authorization).

  1. Insert the URL to the GraphQL API endpoint into the first field.

  2. Insert the GraphQL query in the second field, including the query { ... } part.

  3. Optionally add variables or headers in the third and fourth input fields.

The variables field can be used to e.g. dynamically insert variables into the query.

The headers field can be used e.g. to add authorization info or declare which return type (e.g. json) the query should have, if supported by the endpoint.

To make requests with special characters, you need to declare the whole document input as text as described in Data processing -> Functions -> Inputs

Last updated