---
source: apollo-router/tests/integration/demand_control.rs
expression: parse_result_for_snapshot(response).await
---
{
  "apollo::demand_control::actual_cost": 9.0,
  "apollo::demand_control::actual_cost_by_subgraph": {
    "vehicles": 9.0
  },
  "apollo::demand_control::estimated_cost": 140.0,
  "apollo::demand_control::estimated_cost_by_subgraph": {
    "users": 110.0,
    "vehicles": 30.0
  },
  "apollo::demand_control::result": "COST_OK",
  "apollo::demand_control::result_by_subgraph": {
    "users": "SUBGRAPH_COST_ESTIMATED_TOO_EXPENSIVE",
    "vehicles": "COST_OK"
  },
  "apollo::demand_control::strategy": "static_estimated",
  "apollo::experimental_mock_subgraphs::subgraph_call_count": {
    "vehicles": 2
  },
  "body": {
    "data": {
      "ships": [
        {
          "name": "Ship1",
          "registrationFee": null
        },
        {
          "name": "Ship2",
          "registrationFee": null
        },
        {
          "name": "Ship3",
          "registrationFee": null
        }
      ]
    },
    "errors": [
      {
        "extensions": {
          "code": "SUBGRAPH_COST_ESTIMATED_TOO_EXPENSIVE",
          "cost.subgraph": "users",
          "cost.subgraph.estimated": 110.0,
          "cost.subgraph.max": 1.0,
          "service": "users"
        },
        "message": "query estimated cost 110 exceeded configured maximum 1 for subgraph users",
        "path": [
          "ships",
          0
        ]
      },
      {
        "extensions": {
          "code": "SUBGRAPH_COST_ESTIMATED_TOO_EXPENSIVE",
          "cost.subgraph": "users",
          "cost.subgraph.estimated": 110.0,
          "cost.subgraph.max": 1.0,
          "service": "users"
        },
        "message": "query estimated cost 110 exceeded configured maximum 1 for subgraph users",
        "path": [
          "ships",
          1
        ]
      },
      {
        "extensions": {
          "code": "SUBGRAPH_COST_ESTIMATED_TOO_EXPENSIVE",
          "cost.subgraph": "users",
          "cost.subgraph.estimated": 110.0,
          "cost.subgraph.max": 1.0,
          "service": "users"
        },
        "message": "query estimated cost 110 exceeded configured maximum 1 for subgraph users",
        "path": [
          "ships",
          2
        ]
      }
    ]
  }
}
