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 really like the possibility to use TypedDocumentNode from the GraphQL Code Generator in queries. But unfortunately, it doesn't seem to work as presented here in the docs (at least not with useSubscription which is what I need):
The problem seems to be that the normalizeQuery call comes too late in execute<TData, TVars>. It is called only in the getQueryKey function, but the normalized query value (using print from the graphql package) is needed in the first ...operation property (= query and values) already.
somewhere before creating const context. Then everything works. Of course, you wouldn't need to call normalizeQuery again in getQueryKey then, but simply pass along the value from above.
The text was updated successfully, but these errors were encountered:
I really like the possibility to use
TypedDocumentNode
from the GraphQL Code Generator in queries. But unfortunately, it doesn't seem to work as presented here in the docs (at least not withuseSubscription
which is what I need):https://villus.logaretm.com/guide/typescript-codgen#using-typed-document
The problem seems to be that the
normalizeQuery
call comes too late inexecute<TData, TVars>
. It is called only in thegetQueryKey
function, but the normalized query value (usingprint
from thegraphql
package) is needed in the first...operation
property (=query
andvalues
) already.villus/packages/villus/src/client.ts
Line 48 in 4522450
I tested to insert
somewhere before creating
const context
. Then everything works. Of course, you wouldn't need to callnormalizeQuery
again ingetQueryKey
then, but simply pass along the value from above.The text was updated successfully, but these errors were encountered: