GraphQL Rate Limiting Advanced - Costs API

v1.0.0OAS 3.0

Manage GraphQL schema cost decorations to support advanced query cost-based rate limiting.

API Base URL

List cost decorations for a service

get
/services/{ServiceIdOrName}/graphql-rate-limiting-advanced/costs

Path Parameters

ServiceIdOrNamestringrequired

ID or name of the service.

Response

200 application/json

List of cost decorations

dataarray[object]
Show Child Parameters
200 application/json
{
  "data": [
    {
      "id": "id",
      "type_path": "type_path",
      "add_constant": 1,
      "add_arguments": [
        "[]"
      ],
      "mul_constant": 1,
      "mul_arguments": [
        "[]"
      ],
      "service": "service"
    }
  ]
}

Add a cost decoration to a service

post
/services/{ServiceIdOrName}/graphql-rate-limiting-advanced/costs

Path Parameters

ServiceIdOrNamestringrequired

ID or name of the service.

Body

application/json

GraphQLCostDecorationRequest

type_pathstringrequired

Path to node to decorate, e.g. Query.allPeople

add_constantinteger

Default:1

add_argumentsarray[string]

Default:[]

mul_constantinteger

Default:1

mul_argumentsarray[string]

Default:[]

Response

201 application/json

Cost decoration added

GraphQLCostDecoration

idstring(uuid)required
type_pathstringrequired

Path to node to decorate, e.g. Query.allPeople

add_constantinteger

Cost added to the node

Default:1

add_argumentsarray[string]

List of arguments that add cost

Default:[]

mul_constantinteger

Cost multiplier

Default:1

mul_argumentsarray[string]

List of arguments that multiply cost

Default:[]

servicestring | null(uuid)

Associated service (null if global)

201 application/json
{
  "id": "id",
  "type_path": "type_path",
  "add_constant": 1,
  "add_arguments": [
    "[]"
  ],
  "mul_constant": 1,
  "mul_arguments": [
    "[]"
  ],
  "service": "service"
}

Did this doc help?

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!