ardatan / graphql-mesh

🕸️ GraphQL Federation Framework for any API services such as REST, OpenAPI, Swagger, SOAP, gRPC and more...
https://the-guild.dev/graphql/mesh
MIT License
3.27k stars 340 forks source link

Feedback for “Configure GraphQL Code Generator” #7048

Open jasonseminara opened 5 months ago

jasonseminara commented 5 months ago

I'm having a hard time generating TypedDocumentNodes in mesh. I have had lots of success with the graphql-codegen and the typed DocNodes are generated properly. I can see the document files being ingested at build time, but I dont know where they're going or what mesh is doing with them.

A string search reveals that my client query name is within a getter called rawSDL() but I have no idea how to use it.

ardatan commented 5 months ago

SDK -> https://the-guild.dev/graphql/mesh/docs/guides/mesh-sdk#generating-fully-type-safe-sdk Persisted Operations -> https://the-guild.dev/graphql/mesh/docs/guides/persisted-operations

These are two places Mesh uses documents provided by the user.

jasonseminara commented 5 months ago

Thank you for the quick response!

In the SDK example, my only option is to execute. This doesn't help me generate TypedDocumentNodes to feed to an Apollo Client query hook in React. I'm trying to replace/replicate (or even trigger) the client-preset we've been using in codegen (https://the-guild.dev/graphql/codegen/plugins/presets/preset-client)

Is this possible or do I need to manually trigger it in some custom extension?