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
Is your feature request related to a problem? Please describe.
The Resolvers type generated by typescript-resolvers does not allow for resolving relationships on the types nested resolver, but forces you to fill them in on the base query, even if it was not requested. For example, if a book must have an author, codegen types will make you return the author even if it was not requested
In database terms, its okay to call and return all the fields from a base table and have graphql filter out what it doesn't need and send it to the client, but having to join every possible relationship an entity could have and return them all is highly inperformant, and kills the point of GraphQL.
Describe the solution you'd like
Let's assume the following schema, where a book must have an author.
I should be able to do the below, where I get just the base book on the book query, and can fill in the author on the subresolver if it was requested by the client.
Run codegen and you can now return BookMapper in Query.book
Using Server Preset
Using base plugin can get repetitive and it also doesn't provide runtime safety. We recommend using Server Preset to get a more managed experience so you can focus more on developing features instead of worrying about types.
Hi @asharnadeem , I'll close this issue as it's an expected behaviour. If you have issues using mappers or Server Preset, please create other issues and ping me.
Is your feature request related to a problem? Please describe.
The
Resolvers
type generated bytypescript-resolvers
does not allow for resolving relationships on the types nested resolver, but forces you to fill them in on the base query, even if it was not requested. For example, if a book must have an author, codegen types will make you return the author even if it was not requestedIn database terms, its okay to call and return all the fields from a base table and have graphql filter out what it doesn't need and send it to the client, but having to join every possible relationship an entity could have and return them all is highly inperformant, and kills the point of GraphQL.
Describe the solution you'd like
Let's assume the following schema, where a book must have an author.
I should be able to do the below, where I get just the base book on the
book
query, and can fill in theauthor
on the subresolver if it was requested by the client.Describe alternatives you've considered
No response
Is your feature request related to a problem? Please describe.
No response
The text was updated successfully, but these errors were encountered: