pacyL2K19 / graphql-mongodb-nestjs-tutorial

This is tutorial project that teaches about How to build a Graphql api using Nest MongoDB and NestJS the modern way
10 stars 2 forks source link

Error: Cannot determine a GraphQL input type ("ObjectId") for the "userId". Make sure your class is decorated with an appropriate decorator. #25

Open ajitStephen opened 2 months ago

ajitStephen commented 2 months ago

I have just run install & start added DB and JWT variables from .env

I am getting this error from file : src/app/book/dto/buy-book.input.ts

/home/ajit-stephen/projects/personal/learning/graphql-mongodb-nestjs-tutorial/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 ("ObjectId") for the "userId". Make sure your class is decorated with an appropriate decorator. at InputTypeFactory.create (/home/ajit-stephen/projects/personal/learning/graphql-mongodb-nestjs-tutorial/node_modules/@nestjs/graphql/dist/schema-builder/factories/input-type.factory.js:19:23) at /home/ajit-stephen/projects/personal/learning/graphql-mongodb-nestjs-tutorial/node_modules/@nestjs/graphql/dist/schema-builder/factories/input-type-definition.factory.js:48:52 at Array.forEach (<anonymous>) at /home/ajit-stephen/projects/personal/learning/graphql-mongodb-nestjs-tutorial/node_modules/@nestjs/graphql/dist/schema-builder/factories/input-type-definition.factory.js:46:33 at resolveObjMapThunk (/home/ajit-stephen/projects/personal/learning/graphql-mongodb-nestjs-tutorial/node_modules/graphql/type/definition.js:504:40) at defineInputFieldMap (/home/ajit-stephen/projects/personal/learning/graphql-mongodb-nestjs-tutorial/node_modules/graphql/type/definition.js:1313:20) at GraphQLInputObjectType.getFields (/home/ajit-stephen/projects/personal/learning/graphql-mongodb-nestjs-tutorial/node_modules/graphql/type/definition.js:1276:27) at collectReferencedTypes (/home/ajit-stephen/projects/personal/learning/graphql-mongodb-nestjs-tutorial/node_modules/graphql/type/schema.js:395:51) at collectReferencedTypes (/home/ajit-stephen/projects/personal/learning/graphql-mongodb-nestjs-tutorial/node_modules/graphql/type/schema.js:391:11) at new GraphQLSchema (/home/ajit-stephen/projects/personal/learning/graphql-mongodb-nestjs-tutorial/node_modules/graphql/type/schema.js:183:7)

Do you know what i am missing here ?

pacyL2K19 commented 2 months ago

Hello @ajitStephen

Thank you for raising the issue

May I know which branch you checked out from? I suggest to follow the tutorial from part one to make sure all the required steps are followed, currently I dropped the development of the tutorial, being held by the book project on Nest.js which is going to be released very soon

ajitStephen commented 2 months ago

Hello @ajitStephen

Thank you for raising the issue

May I know which branch you checked out from? I suggest to follow the tutorial from part one to make sure all the required steps are followed, currently I dropped the development of the tutorial, being held by the book project on Nest.js which is going to be released very soon

develop

ajitStephen commented 2 months ago

Ok, I'll the check articles! Thanks for reply!