Add support for graphql-typed-document-node#2353
Conversation
frehner
left a comment
There was a problem hiding this comment.
Hello, thanks for this! We're actually in the process of working on Hydrogen v2, and I've been looking into adding support for typed-document-node in that version. I would love to get your eyes on the v2 implementation if that's ok.
A related question / issue I have, and would love your thoughts or input on: in the past, we have found performance issues with using the GraphQL Documents at runtime, and performance greatly improved when we got rid of the documents (and the document parsing) and just used the raw GraphQL strings.
So I'm a little concerned about the runtime performance implications here of using the print() command from GraphQL. However, it could also be that the performance issues we ran into were caused by creating the Documents, and not by parsing them.
With the client preset of GraphQL codegen, it creates the Documents at build time and not during runtime, so maybe that's ok (or maybe it's not?).
What are your thoughts on the performance implications of this? Also, is there any way to update the client codegen preset to output strings instead of documents so we don't have to use print() at all?
Description
Related #200
I propose to support
typed-document-nodefor more typesafety.https://github.com/dotansimha/graphql-typed-document-node
Additional context
Before submitting the PR, please make sure you do the following:
fixes #123)yarn changeset addif this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning