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) |
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. |
|
Yes, that will work, so I get it to generate something like below. I will hv a look at the code 👍 Thanks! |
|
@thisarattr the feature was released in 5.3.0. |
@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.