Why am I getting a warning related to 'type name collision' using graphql-spqr-spring-boot-starter?

558 Views Asked by At

Could someone please help me here, I'm getting a warning something related to 'type name collision' as follows. I'm using 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.

I referred to the page https://github.com/leangen/graphql-spqr/wiki/Errors#non-unique-type-name but couldn't find/understand how to fix it. I'm new to graphql, anyone's help would be much appreciated.

1

There are 1 best solutions below

0
On

Based on this your warning is benign.

If two different types end up with the same name, it will log a warning. A type is a fully qualified annotated, generic type. So even a single annotation differing is enough to trigger it. In your case, String and @Valid String are different types. The reasoning is that annotations can influence the mapping.