Open janicduplessis opened 4 years ago
I think this issue is aimed to @types/react-relay
on DefinitelyTyped
The problem is that the generated type for queries only contains $fragmentRefs and the one for the generic parameter of useFragment only $data meaning there is no overlap between the types which causes the error.
Off-hand, I'd say we need to expand the typing emitted from this plugin for queries to include those new keys.
Not sure if this is a limitation of typescript but it seems like it cannot infer fragment types from a query response.
Adding an annotation to useFragment does fix it