gqlgen icon indicating copy to clipboard operation
gqlgen copied to clipboard

Add Directives to Resolver Comments

Open aurelius-adrian opened this issue 5 months ago • 5 comments

The default resolver template for code generation is altered such that, the directives that are called are listed in the comment area above the resolver function definition. Parameters of the directives are also included in the output.

This PR closes my issue #3762

As this is a very minor (non-functional) feature, I have not included the following items -> I have:

  • [ ] Added tests covering the bug / feature (see testing)
  • [ ] Updated any relevant documentation (see docs)

aurelius-adrian avatar Jul 14 '25 10:07 aurelius-adrian

Coverage Status

coverage: 73.134%. remained the same when pulling 8f1e7013458acf7ba6dacf083c88c9562b17e183 on aurelius-adrian:master into fadac6f93abf5b7516c0d16e815aeafbc8d63c93 on 99designs:master.

coveralls avatar Jul 14 '25 13:07 coveralls

@aurelius-adrian This has PR causes a number of CI failures for our fmt-and-generate. This will have a similar effect for anyone who uses this in their own systems, so I think you should add a config option to allow people to opt-in to this new behavior. I think it is valuable, but I think that some people might want to keep their comments more succinct.

StevenACoffman avatar Jul 26 '25 20:07 StevenACoffman

@StevenACoffman I will try to look at it to add an option in the config file and resubmit.

aurelius-adrian avatar Jul 26 '25 20:07 aurelius-adrian

@aurelius-adrian Is this something you are still planning on resubmitting?

StevenACoffman avatar Sep 12 '25 13:09 StevenACoffman

Yes, although I am currently involved in other projects and will likely only get to it in mid October.

aurelius-adrian avatar Sep 12 '25 14:09 aurelius-adrian