GraphQL Settings
After you have selected the API (the Shopify API or a generic GraphQL API) to call, you need to define the following in the GraphQL Settings dialog (screenshot below):
•connection settings
•HTTP security settings
•header parameters
•a query or a mutation
The description of the available GraphQL settings is provided in the subsections below.
Connection settings
Setting | Description |
---|---|
URL | The URL text box specifies the address (URL) of the web service you want to call.
|
Dynamic URL (supplied by mapping) | If you would like to supply the URL of the web service from the mapping, select the Dynamic URL (supplied by mapping) check box. This creates an additional input connector in the web service component in the mapping to which you can connect some input that provides the URL of the web service.
With fully dynamic URLs, the entire URL is mappable and you have complete control over it. The only requirement is that the URL must begin with http:// or https:// and it must be a valid URL. Dynamic URLs also make it possible to supply the URL returned from a web service call as input to another component which may call the same (or some other) Web service.
|
Timeout | The Timeout parameter defines the time interval after which the web service call will time out if there is no response from the server. Select Infinite if the call should wait for a response for an indefinite amount of time.
|
HTTP security settings
You may need to configure HTTP security settings in the following scenarios:
•The web service is called through HTTPS and requires a client certificate.
•The server uses an incorrect certificate, and you would like to allow a host name mismatch between the certificate and request.
•The web service requires basic HTTP authentication or OAuth 2.0 authorization.
For more information, see HTTP Security Settings.
Header parameters
In this section of the dialog, you can specify additional HTTP headers. Some GraphQL APIs such as the Shopify API use HTTP headers for authentication and custom API features.
Get schema
If your GraphQL API uses header parameters for authentication, it is essential to provide a correct access token parameter. If the schema from the server has not been loaded automatically, or if you want to update the schema, press the Get Schema button.
Clicking the Get Schema button also updates the schema cache file if you have chosen to save it (see below).
Save schema cache file (optional)
A schema cache file is a locally stored GraphQL schema. Instead of fetching the schema from the server every time, MapForce can retrieve data from the cached file. This helps avoid repeated queries and reduces load on the server.
To save the schema cache file, you can select any of the methods below:
•you can type or paste the path of the schema cache file in the text field, or
•you can click Browse, select a location, give the file a name, and click Save.
Click OK in the GraphQL Settings dialog so that the schema cache file gets saved.
Query/mutation editor
In the editor, you can define only one GraphQL operation (a query or a mutation) and zero or more fragments. The rough guidelines are described below:
1.The starting point is to select an operation you would like to define.
2.After that, you can supply the name of the operation, add fields, arguments, variables, aliases, fragments, directives, and meta fields. The explorer pane on the right-hand side of the editor provides the list of all the items available in the schema for the current cell. The explorer pane also shows the data type and description of the selected item.
3.As soon as you are done defining your query or mutation, press OK. A web service call component will appear in the mapping area.
4.Proceed to work on the design of your mapping as required.
For information about basic concepts associated with GraphQL queries and mutations, see the following pages:
To get an idea about how to define queries and mutations in MapForce, see the following topics:
Save all file paths relative to MFD file
If this option is enabled, MapForce saves the file paths displayed in the component settings relative to the location of the MapForce Design (.mfd) file. See also Relative and Absolute Paths.