GraphQLDataSource Wizard of the Report Designer
The GraphQL Data Source Wizard allows you to create new or edit existing GraphQLDataSource components based on several settings. After the wizard appears, you have to perform the following steps:
-
Configure data retrieval: Setup the properties of the HTTP request which will retrieve data from the GraphQL service:
Setting Description Service URL The URL the request is sent to. Returns the data from the GraphQL service. Required. Authentication Type The authentication type. The supported options are Basic and 2-step authentications. Encoding Data encoding. Default is UTF-8. And/or enter data inline:
Setting Description Source The inline data string containing the data. Required if Service URL or external data file is not set. And/or reference an external data file:
Setting Description Source The external data file containing the data. The URI to the file might be relative or absolute. Required if Service URL or inline data string is not set. -
Configure request parameters: The parameters of the HTTP request to be applied. The supported types are Query, Header, Cookie, and Inline. The inline parameters are parameters that are used to replace parameter tokens (@param1) in the URL and the GraphQL Query fields with an expression result or static value. For more information about the different types of parameters, refer to Using Parameters in the GraphQLDataSource.
-
Basic Authentication
Setting Description Username The username used to authenticate. Required. Password The password used to authenticate. -
2-Step Authentication
Setting Description Login URL This URL returns the authentication token or session key that allows you to access the API. Required. Username The username used to authenticate. The username and password are needed only when the Login URL uses Basic Authentication to retrieve the authentication token/key. Password The password used to authenticate. Body The body of the login HTTP request. Token Path This is a regular expression that allows to retrieve the authentication or session key from the response received via the Login URL. For example, when the Login URL returns a JSON response containing the authentication token in the form: {"access_token":"cbm9W3MeTeVPuO5CIq_DTvG5KbzydpRQ","token_type":"bearer","expires_in":1799,"userName":"demouser",".issued":"Tue, 15 May 2018 08:42:32 GMT",".expires":"Tue, 15 May 2018 09:12:32 GMT"} the token path regular expression to retrieve the token would be: (?:"access_token":")(.?)(?:")* Logout URL This URL is called if the resource features a lockout for having too many sessions open. Refresh the report and try again after successfully logging out. Logout Body The body of the logout HTTP request. 2-Step Authentication Parameters: The parameters of the HTTP request to be applied. The supported types are Query, Header, Cookie and Inline. The inline parameters are parameters that are used to replace parameter tokens (@param1) in the URL and the Body fields with an expression result or static value.
-
Preview data source results: Allows you to preview the result from the configurations you have applied so far.
Setting Description Data Selector The JSONPath expression string which will be used to query the data. For more information, refer to How to Use JSONPath to filter JSON data.