Skip to content

Commit

Permalink
Document nested filter limitations (#219)
Browse files Browse the repository at this point in the history
Signed-off-by: Di Wang <[email protected]>
  • Loading branch information
hemslo authored May 30, 2024
1 parent 1dc45ba commit 88b8ab0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,6 @@ Filtering is also supported on nested structures of a resource.
}
}
```

Note this feature currently only support non array fields,
the behaviour of filter list fields is undefined.
17 changes: 17 additions & 0 deletions test/filter/filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,21 @@ describe('pathobject', async () => {
resp.body.data.test.length.should.equal(1);
resp.body.data.test[0].name.should.equal('resource H');
});

// nested filter with list field eq is not fully supported
it('filter object - referenced object - list field eq', async () => {
const query = `
{
test: resources_v1(filter: {reference_list: {filter: {name: "resource A"}}}) {
name
}
}
`;
const resp = await chai.request(srv)
.post('/graphql')
.set('content-type', 'application/json')
.send({ query });
resp.should.have.status(200);
resp.body.data.test.length.should.equal(0);
});
});

0 comments on commit 88b8ab0

Please sign in to comment.