The GraphQL API toolkit provides methods for making common requests to the Atlassian GraphQL Gateway from a Forge app.
To access GraphQL APIs from your app, install the latest GraphQL API Toolkit package by running:
1 2npm install @atlassian/forge-graphql
Import the @atlassian/forge-graphql
package into your Forge app:
1 2import graphqlGateway from "@atlassian/forge-graphql";
The following example request uses the getComponent
method to fetch details about a Compass component. When executing this code, define a componentId
variable, which you can find on any component on your Compass site.
1 2const { errors, data } = await graphqlGateway.compass.asApp().getComponent({ componentId });
To view the full documentation for the GraphQL API toolkit, visit the reference documentation.
Rate this page: