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

Split generated.go output to different files according to operations files name on generate #248

Closed
ercross opened this issue Jan 24, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ercross
Copy link

ercross commented Jan 24, 2023

Is your feature request related to a problem? Please describe.
The generated.go file may easily become too long and hard to maintain because all query functions are written into it

Describe the solution you'd like
With gqlgen, resolvers may be configured to be generated into different files based on schema file names. A similar approach should be employed here, where instead of writing all query functions into one single file (i.e., generated.go), query functions are written in file corresponding to their operations filename. For instance, if

operations:
     - queries.graphql
     - mutations.graphql
     - types.graphql     

The generated output should be

generated:
     - queries.go
     - mutations.go
     - types.go # provided types.graphql contains any query, mutations
@ercross ercross added the enhancement New feature or request label Jan 24, 2023
@ercross ercross closed this as completed Jan 24, 2023
@ercross ercross closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2023
@benjaminjkraft
Copy link
Collaborator

Dupe of #185. If you could, it would be helpful to have comments on that issue describing why this is useful to you and how it should work to solve your problem -- for example why is it an issue that the generated file is so long (you're not really intended to look at it by hand).

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