Open MateusAndrade opened 11 months ago
Still running into this issue. Has anyone figured out a workaround for this?
Just pass the $key type as generic argument directly to useFragment.
what about define the type explicitly?
type Props = {
queryRef: FirstFragment_query$key
}
useFragment<FirstFragment_query$key>(graphql`
fragment FirstFragment_query on Query {
id
}
`, props.queryRef)
useFragment
Hello, while I'm using two
useFragment
inside my component, the data coming from the second call gets eitherunknown
or{}
with Typescript:E.g:
I'm spreading the
PersonFragment
inside theFirstFragment
, I checked for the types created by relay and Indeed they show the right definition for it, but for some reason, either Typescript/VS-Code isn't able to infer the type here.