Closed nilshartmann closed 6 years ago
I created a unit test in the project to reproduce this issue and I indeed see the same error. I haven't used multiple resolvers for the same data class myself before, and not sure if it is intended to work with multiple resolvers this way actually. They are supported for other (root) types though, so would expect them to be supported in this case as well. Will mark it as a bug.
Thanks for your investigation and the info about the getIndexOffset()
value. Adding a check for MultiResolverInfo
fixed the issue.
Version of graphl-java-tools:
5.2.3
In my schema I have a Type like this:
For the
friends
field onPerson
I wrote an ownGraphQLResolver
:At runtime I receive the following Exception when adding
friends
to my query:For me it seems, that
MethodFieldResolver
uses the wrong target type when deserializing the argument (it usesPerson
instead ofString
).Defining a resolver function with an argument on root level works fine and also defining a field resolver without arguments on
Person
works as expected:Update: it might be related to having more than one
GraphQLResolver
for the same data class:MethodFieldResolver.getIndexOffset()
false
is returned when having more than one resolver (as the fieldresolverInfo
in base classFieldResolver
then at runtime isMultiResolverInfo
and notNormalResolverInfo
)Is this a bug? Or am I doing something wrong? Should multiple resolvers work? (Field resolvers without arguments seem to have no problems)
Thanks for your help!