Closed Yamashou closed 7 months ago
The recent modifications across several files introduce conditional logic to both the generation and operation of queries and mutations. This includes checks before proceeding with logic in source files, conditional type declaration generation based on queries, streamlined method logic in client code, and configurable code generation options in configuration files. These changes enable more flexible and efficient code generation tailored to the presence of queries and mutations.
Files | Change Summary |
---|---|
clientgen/.../source.go , clientgenv2/.../source.go |
Added conditional checks in Query and Mutation methods; return nil, nil if conditions aren't met. |
clientgen/template.gotpl , clientgenv2/template.gotpl |
Introduced conditional logic for type declarations based on query presence. |
clientgenv2/client.go |
Simplified MutateConfig method logic by removing conditional checks and directly invoking Query and Mutation . |
config/config.go |
Modified GenerateConfig to include Query , Mutation , and methods for conditional code generation control. |
example/github/.gqlgenc.yml |
Added query: false and mutation: false settings to control generation behavior. |
🐇✨
Changes afoot in the code we weave,
Queries and mutations, to stay or leave.
Conditional flows, a clever dance,
In code's garden, we advance. 🌿
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Refactor
MutateConfig
method for improved readability and efficiency.Chores