{"record":{"id":"42578707642b2228","repo":"gitbutlerapp/gitbutler","slug":"github-graphql-response-did-not-include-data","errorCode":null,"errorMessage":"GitHub GraphQL response did not include data","messagePattern":"GitHub GraphQL response did not include data","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-github/src/client.rs","lineNumber":1856,"sourceCode":"    #[derive(Deserialize)]\n    struct GraphQlResponse {\n        data: Option<serde_json::Value>,\n        errors: Option<Vec<GraphQlError>>,\n    }\n\n    let payload: GraphQlResponse = serde_json::from_slice(body)?;\n\n    if let Some(errors) = payload.errors {\n        let messages = errors\n            .into_iter()\n            .map(|error| error.message)\n            .collect::<Vec<_>>()\n            .join(\"; \");\n        bail!(\"GitHub GraphQL returned errors: {messages}\");\n    }\n\n    let Some(data) = payload.data else {\n        bail!(\"GitHub GraphQL response did not include data\");\n    };\n\n    Ok(serde_json::from_value(data)?)\n}\n\npub struct PullRequestNodeId {\n    id: String,\n}\n\nimpl PullRequestNodeId {\n    pub fn from_string(value: String) -> Self {\n        PullRequestNodeId { id: value }\n    }\n}\n\nimpl Serialize for PullRequestNodeId {\n    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>\n    where","sourceCodeStart":1838,"sourceCodeEnd":1874,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-github/src/client.rs#L1838-L1874","documentation":"The GitHub GraphQL response contained neither an `errors` array nor a `data` field, so the client has nothing to deserialize. This indicates a structurally unexpected response from GitHub — the payload shape violated the GraphQL contract this client expects.","triggerScenarios":"A GraphQL call in but-github's client where the parsed payload has `errors: null` and `data: null` — e.g. a proxy or gateway returning an empty/invalid JSON body, or a schema/type mismatch deserializing the response envelope.","commonSituations":"Corporate proxies or GitHub incident/degraded states returning empty 200 responses; an API preview or schema change removing the expected field; a bug where the response was consumed before parsing.","solutions":["Log the raw response body before parsing to see what GitHub actually returned.","Check the GitHub status page for incidents affecting the GraphQL API.","Retry the request once — transient gateway issues often produce empty payloads.","Verify the client's GraphQL response struct still matches the current GitHub GraphQL schema.","Ensure no middleware/proxy is stripping or rewriting the response body."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match client.call().await {\n    Ok(v) => v,\n    Err(e) if e.to_string().contains(\"did not include data\") => {\n        tokio::time::sleep(Duration::from_secs(2)).await;\n        retry_with_backoff(3).await // transient gateway/empty-body issue\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Log raw response bodies on parse failures to diagnose empty payloads.","Retry idempotent GraphQL queries once on empty-data responses.","Monitor GitHub status and prefer circuit-breaking during incidents.","Avoid proxies that may strip response bodies."],"tags":["github","graphql","api","unexpected-response"],"backgroundTag":"unexpected-api-response-shape","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}