GraphQL

UI Bakery allows you to easily connect to GraphQL with no need for additional layers like APIs and 3rd-party services.

Prerequisites

If your API is hosted behind a Firewall, add the following IP address to the Firewall whitelist:

52.176.109.125

Configuration

  1. Go to Datasources - Connect - GraphQL.

  2. Enter URL to your GraphQL server. You can provide HTTP headers and Query Params, it will be sent with every query to the data source, but it can also be overwritten for every specific query in the action configuration.

  3. Authentication can be done with custom HTTP header or query param. If your server is secured with Basic Auth, provide the username and the password in Basic Auth settings.

If your server doesn't support GraphQL introspection queries, then uncheck the Load and save GraphQL schema checkbox. GraphQL queries will continue to work, but autocomplete suggestion in the query editor will be limited.

Usage

  1. Create a new action, select the GraphQL data source you want to query, and choose a GraphQL query.

  2. Specify your query. If you need to pass user's data in your query, use GraphQL variables.

Error handling

By default, GraphQL server returns status 200 response even if the query failed. UI Bakery considers a request failed if it contains errors in response, errors cab be accessed via {{error}} action variable. You can also access raw GraphQL response with {{res}} variable.

Last updated