Skip to content

TypeMappingException: Multiple methods detected for operation “opName” with different return types

Working with graphql-spqr and Spring Boot, I’m trying to run the project but I run into this:

exception:org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'graphQLSchema' defined in class path resource 
Bean instantiation via factory method failed; 
nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate 
[graphql.schema.GraphQLSchema]: Factory method 'graphQLSchema' threw exception; 
nested exception is io.leangen.graphql.metadata.exceptions.TypeMappingException: 
Multiple methods detected  for operation "defaultInstanceForType" with different 
return types. Types found: [,]. 
If this is intentional, and you wish GraphQL SPQR to infer the most common super type automatically, see 

and I got redirected to this for help :

I was not having multiple methods with the same name which triggers me, the URL in the exception is not helpful and can’t even be edited or commented.



Removing the protobuf Timestamp fields fix the problem!

After changing my return Object it worked out, I had to refactor to Date, LocalDate or even String and it works perfectly.

User contributions licensed under: CC BY-SA
5 People found this is helpful