有没有人能帮帮我,我收到了一个关于“类型名称冲突”的警告,如下所示。我使用的是graphql-spqr-spring-boot-starter。
2020-06-06 19:04:15.972 WARN 22428 --- [ main] i.l.graphql.generator.OperationMapper : Potential type name collision detected: 'String' bound to multiple types: java.lang.String (loaded by the bootstrap class loader) and @javax.validation.Valid() java.lang.String (loaded by the bootstrap class loader). Assign unique names using the appropriate annotations or override the TypeInfoGenerator. For details and solutions see https://github.com/leangen/graphql-spqr/wiki/Errors#non-unique-type-name. If this warning is a false positive, please report it: https://github.com/leangen/graphql-spqr/issues.我参考了页面https://github.com/leangen/graphql-spqr/wiki/Errors#non-unique-type-name,但无法找到/理解如何修复它。我是graphql的新手,任何人的帮助都将不胜感激。
发布于 2021-05-28 01:32:04
基于this,你的警告是良性的。
如果两个不同的类型以相同的名称结束,它将记录一个警告。类型是完全限定的带注释的泛型类型。因此,即使是一个不同的注释也足以触发它。在您的示例中,
String和@Valid String是不同的类型。理由是注释可以影响映射。
https://stackoverflow.com/questions/62240291
复制相似问题