API7 Docs

List all GraphQL cost decorations in a service on a gateway group

GET /apisix/admin/services/{service_id}/graphql_cost_decorations

GET /apisix/admin/services/{service_id}/graphql_cost_decorations

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Path Parameters

service_id*string

The unique identifier of the service.

Match^[a-zA-Z0-9-_.]+$
Length1 <= length <= 256

Query Parameters

gateway_group_id*string

Gateway group ID. Optional when using the gateway group admin key to authenticate.

Length1 <= length

Response Body

application/json

application/json

curl -X GET "$API_BASE_URL/apisix/admin/services/bd58fce2-b6cc-4d2d-a53c-6ce11b19c101/graphql_cost_decorations?gateway_group_id=86fb9981-d9d2-4555-9df8-91ae92129335"

Successfully retrieved the list of GraphQL cost decorations.

{
  "total": 1,
  "list": [
    {
      "name": "us-west-rsc",
      "desc": "Object description.",
      "labels": {
        "version": "v2",
        "env": "prod"
      },
      "field_path": "string",
      "add_value": 0,
      "add_arguments": [
        "string"
      ],
      "mul_value": 0,
      "mul_arguments": [
        "string"
      ],
      "id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
      "gateway_group_id": "bc1b95c9-b348-4832-acc3-e257d2342df1",
      "apisix_service_id": "b32e678e-7f6b-4a50-b113-550621ed4c01",
      "created_at": 1742288232,
      "updated_at": 1742288235
    }
  ]
}
Complete operation details and schema variants

GET /apisix/admin/services/{service_id}/graphql_cost_decorations

List all GraphQL cost decorations in a service on a gateway group

List the GraphQL cost decorations attached to a service through an APISIX Admin API compatible endpoint under /apisix/admin/. Together they are the service's GraphQL cost model. Required IAM Permission: Action gateway:GetPublishedService, Resource arn:api7:gateway:gatewaygroup/%s/service/%s

Parameters

  • service_id (path, string, required): The unique identifier of the service.
  • gateway_group_id (query, string, required): Gateway group ID. Optional when using the gateway group admin key to authenticate.

Responses

  • 200: Successfully retrieved the list of GraphQL cost decorations.
  • allOf variant 1
  • list (array, optional): An array of resources.
  • total (integer, optional): Total number of objects.
  • allOf variant 2
  • list (array, optional): An array of GraphQL cost decorations.
  • allOf variant 1
  • list[].name (string, optional): The object name.
  • list[].desc (string, optional): The object description.
  • list[].labels (object, optional): Key-value pairs of labels.
  • list[].field_path (string, required): The decorated position in the schema graph. A single <GraphQL type>, for example Product, weights every field returning that type; the root type (Query or Mutation) names the operation itself and so weights the whole query. <GraphQL type>.<field>, for example Query.products, weights that field wherever it is selected. Further field segments pin the decoration to one chain of selections, as in Query.products.nodes.reviews.
  • list[].add_value (number, optional): The field's own cost, added after the fields selected under it have been totalled and multiplied. Defaults to 1.
  • list[].add_arguments (array, optional): Query arguments whose values are added to add_value.
  • list[].mul_value (number, optional): Multiplies the cost of everything selected under the field, which is how a paginating argument turns into fan-out. Defaults to 1.
  • list[].mul_arguments (array, optional): Query arguments whose values are multiplied into mul_value. Under the node_quantifier strategy only a field that carries one of these in the query contributes any cost at all.
  • allOf variant 2
  • list[].id (string, optional): The object ID.
  • list[].gateway_group_id (string, optional): The gateway group ID.
  • list[].apisix_service_id (string, optional): The service ID.
  • list[].created_at (integer, optional): The object created timestamp.
  • list[].updated_at (integer, optional): The object updated timestamp.
  • 400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
  • value (object, optional): The specific resource.
  • error_msg (string, optional): The error message.

cURL

curl -X GET '$API_BASE_URL/apisix/admin/services/{service_id}/graphql_cost_decorations'