Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ricardodalarme opened this issue May 7, 2024 · 2 comments
Closed

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

ricardodalarme opened this issue May 7, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ricardodalarme
Copy link

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

  • N/A
@ricardodalarme ricardodalarme added the enhancement New feature or request label May 7, 2024
@benjaminjkraft
Copy link
Collaborator

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?

@benjaminjkraft
Copy link
Collaborator

benjaminjkraft commented Aug 13, 2024

I'd like to know more about the compatibility implications before we support this explicitly! It would be nice to know even if we don't, since there may be some gaps in our compatibility statement implied here as well -- we try to support compatibility for most things you might reasonably do with the types after getting them from the client (e.g. roundtripping JSON) but when it comes to using them for another client it's hard to know what quasi-internals (e.g. struct tags) it might depend on. Anyway, if you're able to provide more details, or if others have similar needs and can explain them accordingly, please do post and we can reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants