You can import GraphQL schemas as APIs to IBM® App Connect to create connectors that you can use in your
flows.
Before you begin
Before you use App Connect with an imported GraphQL API, check the GraphQL restrictions.
About this task
GraphQL is a query language for APIs and a runtime that runs
queries with your own data. You can import GraphQL APIs to App Connect, then connect to them and add them to your flows.
Procedure
To add an imported GraphQL API to App Connect, complete the following steps.
-
In the App Connect Designer navigation pane, expand
Connect, click Applications and APIs, then click the
Add connector or API icon (+).
- On the Import or discover page, select Import a connector
file or API document, then click Next.
- On the Import document page, set the Document
type to GraphQL.
- Provide the OpenAPI file in one of the following ways,
then click Next.
- Drag a .graphql file into the Import box.
- Click in the Import box then find the .graphql file
from a local or network drive.
- On the Review properties page, enter a name for the API so that you
can identify it on the App Connect
Applications and APIs page.
The name can be a maximum of 30
alphanumeric characters and can include spaces, hyphens, underscores, periods, colons, ampersands,
asterisks, and parentheses.
You
can also enter a description of up to 250 characters that summarizes the functions of the API.
The defined operations in the imported file are shown as actions.
Note: The Custom GraphQL
query object is available by default for all imported GraphQL API connectors. You can use the associated Run custom
GraphQL query action to run a custom GraphQL query to
request data from a GraphQL server based on your specific
needs.
- Click Import connector.
Results
The imported connector is shown in the
Not connected section of connectors
on the
App Connect
Applications and APIs page. Expand the connector to see the available actions
that you can use in your flows, and to connect to the API.
What to do next
- To pass data between an imported API and other applications or APIs on the
Applications and APIs page, you must connect App Connect to each API and application in the flow. You can connect to
the API from the flow editor when you add it to a flow or you can connect from the
Applications and APIs page.
- After you connect to the API, you can add it as a target application to a flow.
- When you no longer need the API, you can remove it from the Applications and
APIs page.
For more information, see
How to
use IBM App Connect with imported GraphQL APIs.