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
Some libraries (such as very old mongoose versions) does not use native promises and use an old promise system that for instance won't support the .catch statement. those things are typically "thenable" but not "catchable". The issue here is that GraphQL execution engine considers everything "thenable" as "catchable".
This triggers the following stacktrace:
TypeError: completed.catch is not a function
at completeValueWithLocatedError (node_modules/graphql/execution/execute.js:493:29)
at completeValueCatchingError (node_modules/graphql/execution/execute.js:467:21)
at resolveField (node_modules/graphql/execution/execute.js:440:10)
at node_modules/graphql/execution/execute.js:219:20
at process._tickDomainCallback (internal/process/next_tick.js:129:7)
This "bug" isn't really one if you use "real" promises everywhere but is one if you have to deal with legacy systems not quite updated yet.
I will provide a simple fix to this issue if you think it's worth fixing.