Replace Promise
with PromiseLike
in resolver types
#6378
Labels
core
Related to codegen core/cli
help wanted
Extra attention is needed
kind/enhancement
New feature or request
Is your feature request related to a problem? Please describe.
When using non-native Promise library like Bluebird, the return type of resolvers will often be
PromiseLike
, but it doesn't adapt with generated resolver-types because the generated code is using native Promise type.graphql-code-generator/packages/plugins/typescript/resolvers/src/index.ts
Line 138 in 8e4d582
sample code:
error message:
Describe the solution you'd like
Can
Promise
be just replaced withPromiseLike
?📝 https://github.com/graphql/graphql-js/blob/0fef3c49907b63b1ea5a4ff1da7011775f465fc2/src/execution/execute.ts#L505-L506
Describe alternatives you've considered
We can customize it by using
customResolverFn
.So this feature request is not mandatory, but I feel it's better if I don't have to customize and manage it in our code.
Additional context
The text was updated successfully, but these errors were encountered: