Args decorator try to read property of undefined #724
Labels
Bug 🐛
Something isn't working
Community 👨👧
Something initiated by a community
Solved ✔️
The issue has been solved
Milestone
Describe the Bug
I'm not sure if it is a bug, or my specific use case.
I'm creating a custom decorator that inject a generic find function as field function in the ObjectType class. to achive it i'm using the Args decorator as a function but it throws a error in runtine.
To Reproduce
Expected Behavior
I expected that it create a function to resolve prueba field inside object type, but it throws a error
I can resolve the problem just adding a optional chaining in line 11 inside /dist/helpers/findType.js , just like
Logs
at .../node_modules/type-graphql/dist/helpers/findType.js:11
metadataDesignType = reflectedType[parameterIndex];
^
TypeError: Cannot read property '0' of undefined
at .../node_modules/type-graphql/dist/helpers/findType.js:11:43)
at Object.getParamInfo (.../node_modules/type-graphql/dist/helpers/params.js:10:49)
at. .../node_modules/type-graphql/dist/decorators/Args.js:12:25
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: