Missing undefined possible type with conditional `skip` in useSuspenseQuery
Author: simPodCreated Sep 26, 2025Updated Sep 29, 2026
Labels🐞 bug⛑ TypeScript:rose: has-reproduction
Issue Description
const { data } = useSuspenseQuery(
MyDocument,
var === undefined
? { skip: true }
: { variables: { x: var.x } },
);type of data is wrongly inferred to not be undefined. But the type should be T|undefined since skip is possible.
Link to Reproduction
do we have a TS template?
Reproduction Steps
No response
@apollo/client version
3.14.0
Source: apollographql/apollo-client