{
  "id": "api/graphql-http-status-400-mutation-returned-errors",
  "signature": "GraphQL mutation returned HTTP 400 with errors array",
  "signature_zh": "GraphQL 变更操作返回 HTTP 400，附带 errors 数组",
  "regex": "HTTP 400.*errors\\[\\{.*\"message\"",
  "domain": "api",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "GraphQL endpoint returns HTTP 400 when a mutation fails validation or execution, even though the request is syntactically valid JSON.",
  "root_cause_type": "generic",
  "root_cause_zh": "GraphQL 端点会在变更操作验证或执行失败时返回 HTTP 400，即使请求本身是语法有效的 JSON。",
  "versions": [
    {
      "version": "graphql-js v16.8",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "apollo-server v4.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "express-graphql v0.12",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The request body is usually valid JSON; the error is in the mutation logic, not parsing.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Logging alone doesn't fix the underlying mutation error; only masks symptoms.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "GraphQL spec allows 400 for business logic errors; headers are irrelevant.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "In the client, check for errors array in response body even on 400, not just 200.",
      "success_rate": 0.9,
      "how": "In the client, check for errors array in response body even on 400, not just 200.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a GraphQL client like Apollo that handles non-200 responses gracefully.",
      "success_rate": 0.85,
      "how": "Use a GraphQL client like Apollo that handles non-200 responses gracefully.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "In the client, check for errors array in response body even on 400, not just 200.",
    "Use a GraphQL client like Apollo that handles non-200 responses gracefully."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://graphql.org/learn/serving-over-http/#http-errors",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.82,
  "resolvable": "true",
  "first_seen": "2023-09-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}