Skip to main content
GraphQL logo

GraphQL

Overview

GraphQL APIs can be used in Application APIs, Workflows, or Scheduled Jobs, letting you call any internal or external GraphQL API from Superblocks, just like in Postman.

Setting up GraphQL

Set up allowed IP Addresses

If you're using Superblocks Cloud, add Superblocks' IPs as allowed IPs for your GraphQL API. This isn't necessary if your API is available on the public internet or you're using a public API.

If using the Superblocks On-Premise, make sure your agent can connect to your GraphQL API.

Add integration

  1. In the web app, navigate to the Integrations page
  2. Click Add integration
  3. Search for GraphQL and select it from the list of available integrations
  4. Name the integration
  5. Fill out the integration configuration as follows:
    Field
    RequiredDescritpion
    URLGraphQL URL to connect to
    AuthenticationThe authorization type you want to use. See detailed instructions for setting up API auth in our docs on Authentication & authorization
    HeadersList of headers that will be added to requests to your API
  6. Optionally, add more configurations to set credentials for different environments
  7. Click Test Connection to check that Superblocks can connect
  8. Click Create
success

GraphQL connected

Now you can use GraphQL in any Application, Workflow, or Scheduled Job

Fetch Credentials Dynamically

Note, if you need to retrieve credentials on demand with a custom workflow instead of using the pre-built authentication flows, enable "Fetch credentials dynamically". This allows you to run a Superblocks Workflow (which can issue an API call or connect to a secrets manager) to fetch the token and return it for use within your REST API integration form:

Screenshot of Fetch Credentials Dynamically

Fetch credentials dynamically using a workflow

Use GraphQL in APIs

Once your GraphQL integration is created, you can start creating steps in APIs that call your API. To start building an API, go to an Application and create a new API:‌

  1. Select the GraphQL integration from the dropdown
  2. Write your GraphQL Query
  3. Add Variables, if required

Use a GraphQL step in an API to query data

info

Tip: Click "Fill with Demo Data" at the top-right of the GraphQL step to call a demo API with 1 click