Skip to content

Commit e239f77

Browse files
committed
Fix *:1 mapping result
1 parent 751fb94 commit e239f77

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ This file contains the changes made to the package.
33

44
The sections are in descending order of the change date.
55

6+
## [0.1.15]: - 2022-08-20
7+
### Fixed
8+
- `Array.map` error during `*:1` relation mapping.
9+
610
## [0.1.14]: - 2022-08-16
711
### Fixed
812
- Prisma Selections for deeply nested objects were not working correctly.
@@ -38,7 +42,8 @@ object.
3842
The initial version of the package.
3943

4044
[Unreleased]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/v1.0.0...HEAD
41-
[0.1.13]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.3...0.1.14
45+
[0.1.15]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.14...0.1.15
46+
[0.1.14]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.13...0.1.14
4247
[0.1.13]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.9...0.1.13
4348
[0.1.9]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.7...0.1.9
4449
[0.1.7]: https://github.com/incetarik/nestjs-prisma-dynamic-resolvers/compare/0.1.6...0.1.7

src/dynamic-resolvers.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ abstract class DynamicResolverBase {
435435
reverseTableName = sourceTableName,
436436
} = navigationMap
437437

438-
const isArray = relation.indexOf('*') >= 0
438+
const [ _left, right ] = relation.split(':')
439+
const isArray = right.indexOf('*') >= 0
439440

440441
if (sourceProperty in parent) {
441442
const data = (parent as any)[ sourceProperty ]

0 commit comments

Comments
 (0)