Khan / genqlient

a truly type-safe Go GraphQL client
MIT License
1.02k stars 99 forks source link

Add option to not generate the client, only the types #334

Open ricardodalarme opened 2 months ago

ricardodalarme commented 2 months ago

Is your feature request related to a problem? Please describe.

In my project, we use an in-house GraphQL client and only need the types generated without the client code. However, currently, there is no option to generate only the types, which results in unnecessary client code being generated.

Describe the solution you'd like I would like to have an option in genqlient to generate only the types without the client code. This would allow for more flexibility in the generated code and prevent the generation of unnecessary client code.

Describe alternatives you've considered

benjaminjkraft commented 1 month ago

Hmm. In principle I guess we could do this, but I'm a little worried that depending on genqlient's generated code independently from the client would necessarily open you up to compatibility trouble as the details of the generated code may change over time (compatibly with genqlient, of course, but maybe not with another client). Are you able to say more about why you use a separate client, and what it expects of the generated types?