
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
- In the web app, navigate to the Integrations page
- Click Add integration
- Search for GraphQL and select it from the list of available integrations
- Name the integration
- Fill out the integration configuration as follows:
Field
Required Descritpion URL GraphQL URL to connect to Authentication The authorization type you want to use. See detailed instructions for setting up API auth in our docs on Authentication & authorization Headers List of headers that will be added to requests to your API - Optionally, add more configurations to set credentials for different environments
- Click Test Connection to check that Superblocks can connect
- Click Create
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
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:
- Select the GraphQL integration from the dropdown
- Write your GraphQL Query
- Add Variables, if required
Tip: Click "Fill with Demo Data" at the top-right of the GraphQL step to call a demo API with 1 click