使用 graphql-spqr 和 Spring Boot,我正在尝试运行该项目,但我遇到了这个问题:
exception:org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'graphQLSchema' defined in class path resource
[io/leangen/graphql/spqr/spring/autoconfigure/SpqrAutoConfiguration.class]:
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: [com.google.protobuf.Message, com.google.protobuf.MessageLite].
If this is intentional, and you wish GraphQL SPQR to infer the most common super type automatically, see
https://github.com/leangen/graphql-spqr/wiki/Errors#operation-with-multiple-resolver-methods-of-different-types
我被重定向到这个寻求帮助:https ://github.com/leangen/graphql-spqr/wiki/Errors#operation-with-multiple-resolver-methods-of-different-types
我没有触发我的多个同名方法,异常中的 URL 没有帮助,甚至无法编辑或评论。