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
Typed requests with TypedDocumentNode seem amazing. I'm trying to avail of this new-found "super-power", but struggling with how to wrap GraphQLClient.request() in function (for error normalization purposes), without losing the hard-won type inference. Using types copied from the relevant library function signature yields the error below (3rd codeblock).
Has anyone out there slayed this particular dragon?
@n1ru4l / @jschuur / @charlypoly - is this something any of you have already done, or know how to do? (Thanks for putting this capability out into the world.)
Relevant function signature from, graphql-request:
This discussion was converted from issue #417 on February 03, 2024 18:58.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
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
-
Typed requests with
TypedDocumentNode
seem amazing. I'm trying to avail of this new-found "super-power", but struggling with how to wrapGraphQLClient.request()
in function (for error normalization purposes), without losing the hard-won type inference. Using types copied from the relevant library function signature yields the error below (3rd codeblock).Has anyone out there slayed this particular dragon?
@n1ru4l / @jschuur / @charlypoly - is this something any of you have already done, or know how to do? (Thanks for putting this capability out into the world.)
Relevant function signature from,
graphql-request
:My attempt to wrap the request with a function:
The resulting error message (in VS Code):
Beta Was this translation helpful? Give feedback.
All reactions