Closed guy120494 closed 6 years ago
The problem was that getObject
returns a DB entity, and if you have different classes for DB and API entities (as you should), the type resovler will not match any of the possibilities. The most reasonable defalut behaviour I could think of is trying to match a possibility by name, because in most cases the DB name and API are similar (for example: CatDB
and CatApi
)
Agree that the problem is that getObject returns a "DB" entity. If by DB you mean any internal/backend object, they should not be returned by any of the Api objects - and especially the DataFetcher. DataFetcher should return an object usable by the api.
Now union type can have a
TypeResolver
. I also added a defaultTypeResolver
that resolves the type by its name, i.e: The DB and API entities must have similar names, up to "API" suffix in the API entity's name@yarinvak @tdraier as usual, please CR me