Open Maxwell2022 opened 4 months ago
Does any passed in __typename
have to be present as a type
in the schema 100% of the time? If so, we could add a mapping at the schema level through a directive, such as:
type Class @class(name: "ClassType") { ... }
What problem does this feature proposal attempt to solve?
At the moment it seems that lighthouse is not able to resolve entities reference for types that are reserved PHP words out of the box.
For instance we are using this type
Class
in our graph which we didn't have problem with at first, but now that we needEntityReference
resolver this is a problem because lighthouse is looking for a class with the same__typename
which is not possible in PHPclass Class {}
.Which possible solutions should be considered?
Option 1.
Entity reference resolver could be suffixed by
Resolver
orReferenceResolver
to allow fo this to work.Option 2.
Another solution would be to provide a mapping in the lighthouse configuration
Option 3.
Another option would be to use a custom
EntityResolverProvider
(we went down this path)