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
"Abstract type Shape must resolve to an Object type at runtime for field Query.shape. Either the Shape type should provide a \"resolveType\" function or each possible types should provide an \"isTypeOf\" function."
Is there an existing issue for this?
Current behavior
The way the resolve-type.factory.ts is implemented breaks the compatibility with Mercurius' JIT feature.
The
resolveType
function is always converted toasync
, which is currently not supported by graphql-jit:graphql/packages/graphql/lib/schema-builder/factories/resolve-type.factory.ts
Lines 16 to 24 in 188b83a
This causes requests to fail on the following:
Minimum reproduction code
https://github.com/wodCZ/nestjs-graphql-union-reproduction
Steps to reproduce
No response
Expected behavior
The resolveType function of createUnionType should be kept synchronous when defined as synchronous.
Monkey-patching the resolve-type.factory.js from
to (async/await removed)
"fixes" the issue (of course breaking real asynchronous resolveType methods.
Package version
10.0.6
Graphql version
graphql
:16.3.0
@nestjs/mercurius
:10.0.6
mercurius
:9.3.3
NestJS version
8.0.0
Node.js version
17.6.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: