Khan / genqlient

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

Option to generate multiple files #335

Closed ricardodalarme closed 1 month ago

ricardodalarme commented 2 months ago

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

In my project, we follow clean architecture. Currently, genqlient only generates a single file, which makes it challenging to maintain a clean project structure. I'd like to have types generated per feature and next to the directory where the query/mutation/fragment is located.

Describe the solution you'd like

I would like genqlient to support generating multiple files based on the directory of the query/mutation/fragment. This would allow me to organize the generated code more effectively, placing the types next to their respective feature implementations, following the clean architecture principles.

Describe alternatives you've considered

its-a-feature commented 1 month ago

I'm also running into this and would find it extremely useful

benjaminjkraft commented 1 month ago

See #185. Please comment there and reply to the questions as to what would be useful for you! This isn't as simple as it sounds so it's useful to know what, precisely, you would need and why.