GraphQL is a modern way of writing API queries that allow users to retrieve data based on query fields. This way the processing speed of the query is improved and retrieved data size is less compared to other alternatives like REST API calls.
Additional resources: GraphQL documentation
Contents
- A. Set up a GraphQL endpoint connection
- B. Enter your GraphQL endpoint details
- C. Test the connection
- D. Advanced settings
A. Set up a GraphQL endpoint connection
Start establishing a connection in either of the following ways:
- From the Resources menu, select Connections. Then, click + Create connection at the top right.
– or – - While working in a new or existing integration, you can add an application to a flow by clicking Add source or Add destination/lookup.
B. Enter your GraphQL endpoint details
At this point, you’re presented with a series of options for providing GraphQL endpoint authentication.
Name (required): Provide a clear and distinguishable name. Throughout integrator.io imports and exports, you will have the option to choose this new connection, and a unique identifier will prove helpful later when selecting among a list of connections that you’ve created.
Mode (required): Select one of the following options
- Cloud to connect to a publicly accessible server application.
- On-premise to connect to a server that is publicly inaccessible and has an integrator.io agent installed on it.
Base URI (required): Provide the domain for your GraphQL endpoint. The application operates on a single endpoint (traditionally /GraphQL), and all requests are directed to this endpoint.
Authentication type (required): Select an authentication type from the list. Note that HTTP authentication types also apply to GraphQL connectors. Review the HTTP authentication type articles below to determine how to configure your authentication.
- Basic HTTP authentication
- Cookie-based HTTP authentication
- Custom HTTP authentication
- Digest-based HTTP authentication
- OAuth 1.0 HTTP authentication
- OAuth 2.0 HTTP authentication
- Token-based HTTP authentication
- WSSE-based HTTP authentication
C. Test the connection
To test the connection, you must choose an HTTP method and send a request that the endpoint can process.
HTTP method (required): Choose between POST or GET. When you switch from POST to GET, integrator.io will build the query string from the body request content.
Query (required): Enter the query to be processed by the GraphQL endpoint. The supported operation type is either query or mutation. The operation type is required unless you're using the query shorthand syntax, in which case you can't supply a name or variable definitions for your operation. The query may also include an operation name, which is required for a multi-operations query.
Operation name: Only required if your query has two or more operations. A request can only execute one operation at a time.
The operation name is a meaningful and explicit name for your operation. Its use is encouraged because it is helpful for debugging and server-side logging. When something goes wrong, such as errors in your network logs or in your GraphQL server logs, it's easier to identify a query in your codebase by name instead of deciphering the contents. Think of it as a function name in your favorite programming language.
Variable: Defines the JSON variables used in your query. For example, if the query is query HeroNameAndFriends($episode: Episode), define the variable as {"episode":"JEDI"}.
D. Advanced settings
Before continuing, you have the opportunity to provide additional configuration information, if needed, for the GraphQL connection.
Borrow concurrency from (optional): Select another connection from the list....
Concurrency level (optional): Up to 25 allowed....
E. Save the connection
Once you have configured the GraphQL connection, you have a few options for continuing:
- Save – click this button to test the connection, commit the new connection so that it will be available to all integrations for your account
- Cancel – click to exit without saving any new changes
Comments
0 comments
Please sign in to leave a comment.