[typescript-resolvers] Resolvers' default result type should allow async and resolvable object values #7358
Open
Labels
core
Related to codegen core/cli
Is your feature request related to a problem? Please describe.
Without
mappers
, when resolving an object of which some values are promises instead of plain values, typing reports errors while the GraphQL execution is fine (GraphQL default resolver even accepts a resolve function as value and supports promise values).Describe the solution you'd like
By default,
defaultMapper
should beResolvable<T>
whereResolvable
looks like this:(Extracted from this comment)
Describe alternatives you've considered
I successfully use the option
defaultMapper
to wrap object types in aResolvable<T>
, but the purpose of this issue is to make this behavior the default one because that's what GraphQL default execution would accept.Additional context
#1219 started mentioning the issue and #1593 resulted in more options that allows alternative solutions.
The text was updated successfully, but these errors were encountered: