Describe the Bug
Generated file helpers.ts in invalid for TypeScript setups with "noUncheckedIndexedAccess": true in their tsconfig.json.
This is an issue if the code is generated outside of node_modules, for example with the config:
generator typegraphql {
provider = "typegraphql-prisma"
output = "../generated/type-graphql"
}
The issue is due to an unchecked index access:
generated/type-graphql/helpers.ts:27:22 - error TS2488: Type '[string, any] | undefined' must have a '[Symbol.iterator]()' method that returns an iterator.
27 const [[key, { value }]] = Object.entries(argument);
To Reproduce
- Add
"noUncheckedIndexedAccess": true to your tsconfig.json
- Add a custom output to your generator config
Expected Behavior
TS should be able to compile correctly
Environment (please complete the following information):
- OS: MacOS 15.6.1
- Node 22.18.0
typegraphql-prisma 0.28.0
- Prisma version 5.22.0
- TypeScript version 5.9.2
Additional Context
Opening a PR to solve this issue.
Describe the Bug
Generated file
helpers.tsin invalid for TypeScript setups with"noUncheckedIndexedAccess": truein theirtsconfig.json.This is an issue if the code is generated outside of
node_modules, for example with the config:The issue is due to an unchecked index access:
To Reproduce
"noUncheckedIndexedAccess": trueto yourtsconfig.jsonExpected Behavior
TS should be able to compile correctly
Environment (please complete the following information):
typegraphql-prisma0.28.0Additional Context
Opening a PR to solve this issue.