Skip to content

fix(query): findIn should resolve child relations#589

Merged
kiaking merged 3 commits into
masterfrom
bugfix/588-findIn
Mar 8, 2020
Merged

fix(query): findIn should resolve child relations#589
kiaking merged 3 commits into
masterfrom
bugfix/588-findIn

Conversation

@cuebit

@cuebit cuebit commented Mar 6, 2020

Copy link
Copy Markdown
Member

Description

This PR fixes the findIn method not resolving child relations like its counterpart find does. Resolves #588.

Type of PR:

  • Bugfix
  • Feature
  • Enhancement
  • Documentation
  • Other

Breaking changes:

  • No
  • Yes

Details

Consider the following:

User.insert({
  id: 1,
  posts: [{ id: 1 }, { id: 2 }]
})

User.query().with('posts').findIn([1, 2])

Current behavior:

[
  {
    $id: 1,
    id: 1,
    posts: []
  }
]

Behavior changes in this PR:

[
  {
    $id: 1,
    id: 1,
    posts: [
      { $id: 1, id: 1 },
      { $id: 2, id: 2 }
    ]
  }
]

@cuebit cuebit added the bug Something isn't working label Mar 6, 2020
@cuebit cuebit self-assigned this Mar 6, 2020
@codecov

codecov Bot commented Mar 6, 2020

Copy link
Copy Markdown

Codecov Report

Merging #589 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #589   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          47     47           
  Lines        1863   1864    +1     
  Branches      258    258           
=====================================
+ Hits         1863   1864    +1
Impacted Files Coverage Δ
src/query/Query.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b03d84...3794dcc. Read the comment docs.

@cuebit cuebit changed the title fix(Query): findIn should resolve child relations fix(query): findIn should resolve child relations Mar 6, 2020
@kiaking kiaking merged commit e47334b into master Mar 8, 2020
@kiaking kiaking deleted the bugfix/588-findIn branch March 8, 2020 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

findIn not work with relation

2 participants