{
  "id": "api/graphql-http-status-200-with-errors",
  "signature": "GraphQL endpoint returned HTTP 200 with errors array",
  "signature_zh": "GraphQL端点返回HTTP 200但包含错误数组",
  "regex": "HTTP 200\\s*(with|and)\\s*errors\\s*(array|key|field)",
  "domain": "api",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "GraphQL specification allows partial success — HTTP 200 with errors key in response body when some resolvers fail but transport succeeds.",
  "root_cause_type": "generic",
  "root_cause_zh": "GraphQL规范允许部分成功——当某些解析器失败但传输成功时，响应体包含errors键且HTTP状态码为200。",
  "versions": [
    {
      "version": "graphql-js@16.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Apollo Server 4.9.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Apollo Client 3.8.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "graphql-yoga 5.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Checking only HTTP status code (200) without parsing response body for errors field",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Assuming all 200 responses are successful and ignoring errors array entirely",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Setting Apollo Client errorPolicy to 'ignore' which silently discards errors",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "In Apollo Client, set errorPolicy to 'all' to surface errors: new ApolloClient({ uri: '/graphql', errorPolicy: 'all' })",
      "success_rate": 0.9,
      "how": "In Apollo Client, set errorPolicy to 'all' to surface errors: new ApolloClient({ uri: '/graphql', errorPolicy: 'all' })",
      "condition": "",
      "sources": []
    },
    {
      "action": "Parse response body manually: const { data, errors } = await response.json(); if (errors) { console.error('GraphQL errors:', errors); }",
      "success_rate": 0.85,
      "how": "Parse response body manually: const { data, errors } = await response.json(); if (errors) { console.error('GraphQL errors:', errors); }",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a middleware to check for errors in GraphQL responses and throw if any exist",
      "success_rate": 0.8,
      "how": "Use a middleware to check for errors in GraphQL responses and throw if any exist",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在Apollo Client中设置errorPolicy为'all'以显示错误：new ApolloClient({ uri: '/graphql', errorPolicy: 'all' })",
    "手动解析响应体：const { data, errors } = await response.json(); if (errors) { console.error('GraphQL errors:', errors); }",
    "使用中间件检查GraphQL响应中的错误，如果存在则抛出异常"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://spec.graphql.org/June2018/#sec-Errors",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}