Skip to content

Commit

Permalink
make OnlyNeeded the default upsertGraph fetchStrategy
Browse files Browse the repository at this point in the history
  • Loading branch information
koskimas committed Aug 25, 2019
1 parent c31b3ea commit b8e7f70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/queryBuilder/graph/GraphOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GraphOptions {
}

if (!this.options[FETCH_STRATEGY]) {
return strategy === FetchStrategy.OnlyIdentifiers;
return strategy === FetchStrategy.OnlyNeeded;
} else {
return this.options[FETCH_STRATEGY] === strategy;
}
Expand Down
8 changes: 5 additions & 3 deletions tests/unit/relations/ManyToManyRelation.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,11 @@ describe('ManyToManyRelation', () => {
}
});
}).to.throwException(err => {
expect(err.message).to.equal(
"OwnerModel.relationMappings.testRelation: Cannot find module '/not/a/path/to/a/model'"
);
expect(
err.message.startsWith(
"OwnerModel.relationMappings.testRelation: Cannot find module '/not/a/path/to/a/model'"
)
).to.equal(true);
});
});

Expand Down

0 comments on commit b8e7f70

Please sign in to comment.