Closed jasonkuhrt closed 1 week ago
Is it possible to pass in TypedDocumentNode
from https://github.com/dotansimha/graphql-typed-document-node? Im thinking about using the raw client with generated typed document nodes to avoid the client bundle overhead from the generated graffle client. Typed document nodes could likely be tree-shaken per page so that each page only bundles the graphql documents needed instead of a full-blown client.
@P4sca1 yup that will be supported. The PR already achieved that. I just have to tidy everything up. Won't be long, today or tomorrow.
Perceived Problem
Ideas / Proposed Solution(s)
Summary benefits of following idea(s) over current raw approach:
Document Level template literal with variables
Document Level template literal with variables, operation name
Passing in a type variable to have the arguments typed and results inferred.
Using a prepared DocumentNode instance.
The
gql
function can continue to be used as a way to create documents.Access the constructed DocumentNode instance
Sugar: Root Type Level template literal. Interpolates variables into GraphQL document