Skip to content

Commit 31620c6

Browse files
committed
Fix issue when using options.query and querying through a hasMany property. Issue 63
1 parent 0494bb4 commit 31620c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function processRelationField (resourceConfig, query, field, criteria, options,
5252
[`${relationName}.${fieldParts.splice(0).join('.')}`]: criteria // remaining field(s) handled by EXISTS subquery
5353
};
5454
let subQueryTable = getTable(relationResourceConfig);
55-
let subQueryOptions = deepMixIn({ query: knex(this.defaults).select(`${subQueryTable}.*`).from(subQueryTable) }, options)
55+
let subQueryOptions = deepMixIn({}, options, { query: knex(this.defaults).select(`${subQueryTable}.*`).from(subQueryTable) })
5656
let subQuery = this.filterQuery(relationResourceConfig, existsParams, subQueryOptions)
5757
.whereRaw('??.??=??.??', [
5858
getTable(relationResourceConfig),

0 commit comments

Comments
 (0)