Skip to content

Commit

Permalink
Fix *:1 mapping result
Browse files Browse the repository at this point in the history
  • Loading branch information
incetarik committed Aug 19, 2022
1 parent 751fb94 commit e239f77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/dynamic-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]
Expand Down

0 comments on commit e239f77

Please sign in to comment.