GraphQLType Annotation is not interpreted in context of Method-Parameters
In the example code below the parameter version is build into schema as Int! instead of NonNegativeInt!
public class Query {
@GraphQLField
@GraphQLDataFetcher(DocumentDataFetcher.class)
public Document documentByNumber(
@GraphQLNonNull @GraphQLName("number") String number,
@GraphQLNonNull @GraphQLType(NonNegativeIntTypeFunction.class) @GraphQLName("version") Integer version) {
return null;
}
}
resulting in a schema of
documentByNumber(number: String!, version: Int!): Document
The reasons for this behaviour I found are:
ArgumentBuilderdoes not considerGraphQLTypeat all, when building the parameterGraphQLTypedoes not have theElementType.PARAMETERin itsTargetannotation, so it is not possible to get this annotation with reflection at runtime likeparameter.getAnnotation(GraphQLType.class)
Not sure if this is intentional behaviour.
Hello @KlingPa,
Thank you very much for your analysis.
We have never encountered such issues in our projects and our ability to analyze community issues in the graphql-java-annotations project is currently limited; we therefore likely won't be able to address this issue anytime soon.
As you may have already investigated the cause and the problem's impacted code, we would be happy to consider your suggestions on this matter. You can submit a pull request with fixing code to solve the issue and/or tests reproducing the bug. We always strive to review and merge pull requests as quickly as possible.
Thank you for your understanding!
Best regards
Hi @KlingPa ,
We're closing this ticket as inactive.
Feel free to re-open the issue once you have a reproduction scenario, or even better, a PR with the corresponding fix. We'll be happy to review it then.
Thanks,