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
According to #688 and to the docs, a second argument can be sent to PartialType() to change the decorator applied to the parent class, for example changing from ObjectType() to InputType(), but if the parent class is composed of another ObjectType() this change doesn't apply to it, and the schema builder will fail.
This code sample will fail on app startup, with the error:
/Users/project_nestjs/node_modules/@nestjs/graphql/dist/schema-builder/factories/input-type.factory.js:19
throw new cannot_determine_input_type_error_1.CannotDetermineInputTypeError(hostType, typeRef);
^
Error: Cannot determine a GraphQL input type ("ClassB") for the "b". Make sure your class is decorated with an appropriate decorator.
at InputTypeFactory.create (/Users/project_nestjs/node_modules/@nestjs/graphql/dist/schema-builder/factories/input-type.factory.js:19:23)
at /Users/project_nestjs/node_modules/@nestjs/graphql/dist/schema-builder/factories/input-type-definition.factory.js:48:52
at Array.forEach (<anonymous>)
at /Users/project_nestjs/node_modules/@nestjs/graphql/dist/schema-builder/factories/input-type-definition.factory.js:46:33
at resolveObjMapThunk (/Users/project_nestjs/node_modules/graphql/type/definition.js:504:40)
at defineInputFieldMap (/Users/project_nestjs/node_modules/graphql/type/definition.js:1313:20)
at GraphQLInputObjectType.getFields (/Users/project_nestjs/node_modules/graphql/type/definition.js:1276:27)
at TypeFieldsAccessor.extractFromInputType (/Users/project_nestjs/node_modules/@nestjs/graphql/dist/schema-builder/services/type-fields.accessor.js:9:35)
at /Users/project_nestjs/node_modules/@nestjs/graphql/dist/schema-builder/factories/input-type-definition.factory.js:64:66
at resolveObjMapThunk (/Users/project_nestjs/node_modules/graphql/type/definition.js:504:40)
Is there an existing issue for this?
Current behavior
According to #688 and to the docs, a second argument can be sent to
PartialType()
to change the decorator applied to the parent class, for example changing fromObjectType()
toInputType()
, but if the parent class is composed of anotherObjectType()
this change doesn't apply to it, and the schema builder will fail.This code sample will fail on app startup, with the error:
Minimum reproduction code
https://codesandbox.io/s/optimistic-flower-n5qhe9
Steps to reproduce
No response
Expected behavior
The entity to compile without error.
Package version
11.0.5
Graphql version
"graphql": "^16.3.0",
NestJS version
No response
Node.js version
No response
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: