Closed oprypkhantc closed 9 months ago
I wonder if default: true
is the issue here. I guess the caching could be an issue. I think there are separate type mapper caches for input and output types though. So there shouldn't be a collision.
Nevermind, the second option does work. I swear I've tested it 20 times before, clearing the cache after each try and it was broken.
On that note, is the first option even supposed to work? Graphqlite automatically adds the "Input" suffix when generating a name from the class name, but it probably doesn't make sense to do so when name is manually specified?
IIRC, you do need to specify the Input
suffix, else you'll end up with a type name collision. It's redundant though and the Input
suffix is implied.
Hey.
I have a class with a name that I don't want to expose in GraphQL, that's an input and a regular type at the same type:
I'd expect this to work; or, at, least, this to work:
Instead, I'm getting this error when introspecting:
"Expected GraphQL type \"Address\" to be either a MutableObjectType or a MutableInterfaceType. Got a TheCodingMachine\\GraphQLite\\Types\\InputType"
or this error when actually trying to run a query with that type:RuntimeException: Cached type in registry is not the type returned by type mapper.
I'll PR a fix tomorrow.