graphql-cost-analysis

Use the graphql-cost-analysis policy to return a cost analysis of a target query.

Gateway support

Table 1. Table showing which gateways support this policy, and the corresponding policy version
Gateway Policy version
DataPower® API Gateway 2.0.0

This topic describes how to configure the policy in your OpenAPI source; for details on how to configure the policy in the assembly user interface, see GraphQL Cost Analysis.

Properties

Table 2. graphql-cost-analysis policy properties
Property Required Description Data type
version Yes The policy version number. string
title No The title of the policy. string
description No A description of the policy. string
input No

A variable in the API context that contains the input to the GraphQL cost analysis. The content of the body field of the variable is the GraphQL cost query. By default, the variable name is message. The query should be in the format as specified in the IBM GraphQL Cost Directives specification, see Introspection of Cost Analysis Results: __cost.

string
output No

A variable in the API context where the results of the GraphQL cost analysis are stored. The content of the body field of the variable is the result of GraphQL cost analysis. The default variable name is the same as that of the variable specified for the input field. Therefore, by default, the input of the GraphQL cost analysis is overwritten by the output.

string
target No

A variable in the API context that contains the target for the GraphQL cost analysis. The content of the body field of the variable is the GraphQL context. By default, the variable name is graphql_execute_args. The target context specifies the query to analyze and, optionally, the result of the query execution.

string