GraphQL Execute
Use the GraphQL Execute policy to execute a GraphQL query by using sub-queries.
Gateway support
Gateway | Policy version |
---|---|
DataPower® API Gateway | 2.0.0 (DataPower API Gateway Version 10.0.4.0 and later) 2.1.0 (DataPower API Gateway Version 10.5.2.0 and later) |
This topic describes how to configure the policy in the assembly user interface; for details on how to configure the policy in your OpenAPI source, see graphql-execute.
About
The GraphQL Execute
policy executes a GraphQL query by using sub-queries. The policy splits up the original GraphQL
query into different sub-queries that can then be processed in different ways. The GraphQL Execute policy supports
the following four different sub-queries as targets:
root
; contains the core GraphQL query that you want to invoke on the backend.__introspection
; contains the introspection query that can be processed locally on the DataPower API Gateway without having to invoke the backend.__rateLimit
; contains the__rateLimit
query that specifies the different rate limit data that you want to receive.__cost
; contains the__cost
query that specifies the different cost data that you want to receive. This query must be in the format that is specified in the IBM GraphQL Cost Directives specification, see Introspection of Cost Analysis Results:__cost
.
root
, __rateLimit
, and __introspection
targets can be executed in any order, or at the same time. The __cost
target can be
executed at any time if no response data is expected. If response data is expected, then the
__cost
target is executed after the root
target in order to
accurately return correct response cost data. After all the targets are executed, the GraphQL Execute policy combines
all of the responses together. To enable the responses of the individual targets to be correctly
merged with each other into a final, single response, the GraphQL Execute policy must
include all of the introspection types that are associated with each level of the response data.Properties
The following table lists the policy properties, indicates whether a property is required, specifies the valid and default values for input, and specifies the data type of the values.
Property label | Required | Description | Data type |
---|---|---|---|
Title | No | The title of the policy. The default value is |
string |
Description | No | A description of the policy. | string |
Target | No | The target for the sub-queries. Valid values are:
|
string |