You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At [email protected], we could map interface type to our own type. But at v.1.13.1, in the #3538#3618, the behavior is changed. The interface will be the union type of its implements types, even I pass the mapper type in the config. I hope that we can bring interface type mapper back when we have set it in the config.
constresolver={Query: {shell(){returnshellCollections.get();}},Book{__resolveType(parent,_context,_info){// i would like to map the parent type as my model type rather the union of TextBook and ColoringBook}}
That's quite useful if you work in the Apollo Federation.
For example, that's said there are 3 services: Book, User, Organization. In the book service, a book could be published by a user and an organization and I store the type and id in the book database. I would like to resolve the more publisher info from User, Organization services.
In that kind of case, we can not get all of data in the book service and it's interface type resolvers can not determine the type by their unique property. We might use our model type to determine which typename it is. Hence, please consider that:
if an interface is assigned the type mapper, use the mapped type instead of union type.
The text was updated successfully, but these errors were encountered:
I am running into a similar issue. mappers correctly maps simple graphQL type to my own declared Typescript type model. But for a graphQL interface, graphql-codegen is generating unioned Typescript types and ignores my configuration in mappers to use my model for graphQL types in my schema that implements an interface.
At [email protected], we could map interface type to our own type. But at v.1.13.1, in the #3538 #3618, the behavior is changed. The interface will be the union type of its implements types, even I pass the mapper type in the config. I hope that we can bring interface type mapper back when we have set it in the config.
That's said in the same case of books.
If we store the shell data in the nosql database in the following format:
That's quite useful if you work in the Apollo Federation.
For example, that's said there are 3 services: Book, User, Organization. In the book service, a book could be published by a user and an organization and I store the type and id in the book database. I would like to resolve the more publisher info from User, Organization services.
In that kind of case, we can not get all of data in the book service and it's interface type resolvers can not determine the type by their unique property. We might use our model type to determine which typename it is. Hence, please consider that:
if an interface is assigned the type mapper, use the mapped type instead of union type.
The text was updated successfully, but these errors were encountered: