Skip to content

Commit

Permalink
fix(query-graphql): Fix null condition building for cursor filter
Browse files Browse the repository at this point in the history
  • Loading branch information
abrenoch committed Sep 18, 2024
1 parent 4eb6e6b commit 423f320
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ export class KeysetPagerStrategy<DTO> implements PagerStrategy<DTO> {
const subFilter = {
and: [...equalities, { [keySetField.field]: { [isAsc ? 'gt' : 'lt']: keySetField.value } }]
} as Filter<DTO>
equalities.push({ [keySetField.field]: { [keySetField.value === null ? 'is' : 'eq']: keySetField.value } } as Filter<DTO>)
if (keySetField.value === null) {
equalities.push({ [keySetField.field]: { is: null } } as Filter<DTO>)
} else {
equalities.push({ [keySetField.field]: { eq: keySetField.value } } as Filter<DTO>)
}
return [...dtoFilters, subFilter]
}, [] as Filter<DTO>[])
return { or: oredFilter } as Filter<DTO>
Expand Down

0 comments on commit 423f320

Please sign in to comment.