Add custom annotation to all generated resolver methods #783
-
Hi all, I achieved it using custom directive on schema which is added to all fields and use Is there any way to me to achieve that? Thanks in advance! (last option im thinking is to hv some sort of linting to validate it and fail the build) |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hi @thisarattr, thanks for your request. One thing we can do is to support regex in customAnnotationsMapping so that you can provide some wildcard in your config, e.g.:
customAnnotationsMapping = ["Query.*":"com.yourAnnotation"] Please let me know what you think. |
Beta Was this translation helpful? Give feedback.
-
Yes, that will work, so I get it to generate something like below. I will hv a look at the code 👍
Thanks! |
Beta Was this translation helpful? Give feedback.
-
@thisarattr the feature was released in 5.3.0. |
Beta Was this translation helpful? Give feedback.
@thisarattr the feature was released in 5.3.0.
Now you can supply a regex in
customAnnotationsMapping
. E.g.:customAnnotationsMapping = ["Query..*": ["com.your.organization.GqlSecured"], "Mutation..*": ["com.your.organization.GqlSecured"]]
or even:
customAnnotationsMapping = [".*": ["com.your.organization.GqlSecured"]]
Please try it out and let me know how it works.