Closed Gowthaman-Opti-Twin closed 5 months ago
addTypename: false,
This part is likely your problem. Apollo client needs to have the __typename
field available for this functionality to work correctly
Yes, thanks @dylanwulf!
@Gowthaman-Opti-Twin can you confirm this solved your issue?
Yep, that's the issue. It is working fine now. Thanks
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. For general questions, we recommend using StackOverflow or our discord server.
I have a query that uses union types inside it.
sample query
when I try to use
useQuery
from apolloClient it is returning the person object with empty brackets[{},{}]
but when usingfetch()
it is returning[{id:232, lightsaber:green},{id:242, beskar: old}]
I tried specifying the union type in the apollo client
it is not returning the any properties inside the object just an empty object
{}
here is the useQuery
const {data:QueryData} = useQuery<PersonQuery>(GET_PERSON)