Fix relation bug

This commit is contained in:
Alexandre Bodin 2019-03-28 19:30:21 +01:00
parent af66edddf1
commit b08c5bf3d2
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ const buildQuery = ({ model, filters }) => qb => {
let fieldKey = `${associationModel.collectionName}.${attributeKey}`;
if (association && attributeKey === whereClause.field) {
if (association && attributeKey === field) {
fieldKey = `${associationModel.collectionName}.${associationModel.primaryKey}`;
}

View File

@ -217,7 +217,7 @@ describe('Test Graphql Relations API End to End', () => {
createDocument: {
document: {
...selectFields(document),
labels: data.labels.map(selectFields),
labels: expect.arrayContaining(data.labels.map(selectFields)),
},
},
},