If you create InputObjectGraphType and ObjectGraphType with identical names the APi will work but the schema will be invalid.
Create an InputObjectGraphType and ObjectGraphType and set "Name" field to the same string.
I would expect and exception, error message, or some other warning
API runs happily, but the schema it produces is invalid. The playground doesn't work either.
So, to a random user of the library this is really confusing, because there isn't a good way to figure out what's wrong.
This definitely sounds like something that should be fixed. Thanks for the report! I think we do have an issue for something similar, I'll link that if I can find it.
Confusing behavior occurs when a name is duplicated between any object or interface graph type. In these cases, the playground works (or at least displays a schema) but the schema only registers the first graph type, silently skipping the rest. Probably this is due to GraphTypesLookup.AddTypeIfNotRegistered. Since the GraphQL spec mandates uniqueness of all type names, maybe this method should throw an exception when it encounters a duplicate name whose type does not match what's already in the lookup dictionary?
Probably solved in #1284
@VladimirAkopyan Can you check if the problem persists?
Most helpful comment
This definitely sounds like something that should be fixed. Thanks for the report! I think we do have an issue for something similar, I'll link that if I can find it.