You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying get a project up and running with codegen and having some problems I struggle finding fixes for.
One issue I'm having is that, in the example below, the first query will be typed TypeDocumentDode<GetProfileQuery.. etc and work right when imported and placed in a useQuery. The second query will have a type of unknown and thus is unusable. I'm running into this kind of thing quite a bit and I can't seem to figure out the rules governing what the graphql() function will return.
Another issue is that when receiving the response and using useFragment() to get it typed. In the example above any fields in the ProfileFragment will be properly typed, but any nested fragments within that fragment will not. This makes sense, but I cannot find any examples or documentation on how to handle typing nested fragments.
Any pointers as to what I'm doing that's messing up the magic would be much appreciated.
I am using vue3 with apollo.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi.
I'm trying get a project up and running with codegen and having some problems I struggle finding fixes for.
One issue I'm having is that, in the example below, the first query will be typed TypeDocumentDode<GetProfileQuery.. etc and work right when imported and placed in a useQuery. The second query will have a type of unknown and thus is unusable. I'm running into this kind of thing quite a bit and I can't seem to figure out the rules governing what the graphql() function will return.
Another issue is that when receiving the response and using useFragment() to get it typed. In the example above any fields in the ProfileFragment will be properly typed, but any nested fragments within that fragment will not. This makes sense, but I cannot find any examples or documentation on how to handle typing nested fragments.
Any pointers as to what I'm doing that's messing up the magic would be much appreciated.
I am using vue3 with apollo.
Beta Was this translation helpful? Give feedback.
All reactions