Modify costs by score factor

GraphQL query cost depends on multiple factors, based on Kong Gateway’s resolvers and the implementation of the schema. Depending on the cost strategy, individual query costs could become high when using quantifiers, or very low with no quantifiers at all. By using config.score_factor, the cost can be divided or multiplied to a certain order of magnitude.

In this example, a score factor of 0.01 divides the costs by 100, meaning every cost unit represents 100 nodes.

Prerequisites

  • You have an existing a GraphQL upstream service.

Set up the plugin

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!