* [docs]: Update data-sources guides - Clickhouse, CosmosDB, CouchDB * Added padding before h2 * Updated 2.50-LTS/data-source/databricks.md * Updated Databrick * Updated DynamoDB * Updated elasticsearch * Updated GCS * Updated Google Sheets * Updated GraphQL * Updated graphql v2 * Updated graphql v3 * Updated sheets v2 * updated sheets v3 * Updated gcs v2 * updated elasticsearch v2 * updated dynamodb v2 * Updated databrick v2 * Added missing images * Updated docs in 2.68.0
2.3 KiB
| id | title |
|---|---|
| graphql | GraphQL |
ToolJet can establish connections with GraphQL endpoints, enabling the execution of queries and mutations.
Connection
To establish a connection with the GraphQL global datasource, you can either click on the + Add new global datasource button located on the query panel or navigate to the Data Sources page through the ToolJet dashboard.
<img className="screenshot-full" src="/img/datasource-reference/graphql/graphgds-v2.png" alt="ToolJet - Data source - GraphQL" style={{marginBottom:'15px'}}/>
ToolJet requires the following to connect to a GraphQL datasource:
- URL: URL of the GraphQL endpoint.
- Headers: Any headers the GraphQL source requires.
- URL parameters: Additional query string parameters.
- Authentication Type: The method of authentication to use with GraphQL requests.
- None: No credentials or tokens are required.
- Basic: Requires Username and Password.
- Bearer: Requires a token, typically a JSON Web Token (JWT), to grant access.
- OAuth 2.0: The OAuth 2.0 protocol mandates the provision of the following parameters: access token URL, access token URL custom headers, client ID, client secret, scopes, custom query parameters, authorization URL, custom authentication parameters, and client authentication.
Querying GraphQL
- Click on + Add button of the query manager at the bottom panel of the editor.
- Select the GraphQL datasource added in previous step.
- Add the Query.
- Click on the Preview button to preview the output or Click on the Run button to create and trigger the query.
Required Parameters:
- Query
Optional Parameters
- Variable
- Headers
<img className="screenshot-full" src="/img/datasource-reference/graphql/headers-v2.png" alt="ToolJet - Data source - GraphQl" style={{marginBottom:'15px'}}/>
Example
{
todos {
id
description
}
}
:::tip Query results can be transformed using transformations. Read our transformations documentation to see how: link :::