younifyd
Menu

GraphQL Query

Execute a GraphQL query or mutation against a GraphQL endpoint

Use it in a workflow

  1. Add a step and choose the GraphQL connector.
  2. Pick the GraphQL Query action (under graphql).
  3. Fill in the fields below, then reference the result from later steps as {{graphqlQuery.response.data}}.

Fields

urlstring (uri)required

The complete URL of the GraphQL endpoint

querystringrequired

The GraphQL query or mutation string

variablesstring

JSON object with GraphQL variables

operationNamestring

Optional operation name (required if query contains multiple operations)

headerskeyvalue

HTTP headers to include in the request

Examples

Query with variables

Fetch a user by id using a GraphQL variable

json
{
  "url": "https://api.example.com/graphql",
  "query": "query GetUser($id: ID!) {\n  user(id: $id) {\n    id\n    name\n    email\n  }\n}",
  "variables": "{\"id\": \"123\"}",
  "operationName": "GetUser"
}

Need more? See the GraphQL guide for connection setup and behaviour shared by every action.

Was this page helpful?