diff --git a/CHANGELOG.md b/CHANGELOG.md index d83a129..f1f5612 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ This file contains the changes made to the package. The sections are in descending order of the change date. +## [0.1.15]: - 2022-08-20 +### Fixed +- `Array.map` error during `*:1` relation mapping. + ## [0.1.14]: - 2022-08-16 ### Fixed - Prisma Selections for deeply nested objects were not working correctly. @@ -38,7 +42,8 @@ object. The initial version of the package. [Unreleased]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/v1.0.0...HEAD -[0.1.13]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.3...0.1.14 +[0.1.15]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.14...0.1.15 +[0.1.14]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.13...0.1.14 [0.1.13]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.9...0.1.13 [0.1.9]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.7...0.1.9 [0.1.7]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.6...0.1.7 diff --git a/src/dynamic-resolvers.ts b/src/dynamic-resolvers.ts index 7356cee..96ad0da 100644 --- a/src/dynamic-resolvers.ts +++ b/src/dynamic-resolvers.ts @@ -435,7 +435,8 @@ abstract class DynamicResolverBase { reverseTableName = sourceTableName, } = navigationMap - const isArray = relation.indexOf('*') >= 0 + const [ _left, right ] = relation.split(':') + const isArray = right.indexOf('*') >= 0 if (sourceProperty in parent) { const data = (parent as any)[ sourceProperty ]