Skip to content

Commit 2c00d31

Browse files
authored
Backward relations (one-to-one) (#55)
Support filtering on one-to-one backward relations
1 parent 2fd57df commit 2c00d31

12 files changed

+6119
-9
lines changed

__tests__/fixtures/queries/connections-filter.relations.graphql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
query {
22
parent_name_equalTo_parent2: allFilterables(filter: {parentByParentId: {name: {equalTo: "parent2"}}}) { ...filterableConnection }
33
forward_name_equalTo_forward2: allFilterables(filter: {forwardByForwardId: {name: {equalTo: "forward2"}}}) { ...filterableConnection }
4+
backward_name_equalTo_backward2: allFilterables(filter: {backwardByFilterableId: {name: {equalTo: "backward2"}}}) { ...filterableConnection }
5+
#child_name_equalTo_child2: allFilterables(filter: {childrenByFilterableId: {name: {equalTo: "child2"}}}) { ...filterableConnection }
46
}
57

68
fragment filterableConnection on FilterablesConnection {

__tests__/integration/__snapshots__/queries.test.js.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,6 +1859,14 @@ Object {
18591859
exports[`connections-filter.relations.graphql 1`] = `
18601860
Object {
18611861
"data": Object {
1862+
"backward_name_equalTo_backward2": Object {
1863+
"nodes": Array [
1864+
Object {
1865+
"id": 2,
1866+
"string": "Test",
1867+
},
1868+
],
1869+
},
18621870
"forward_name_equalTo_forward2": Object {
18631871
"nodes": Array [
18641872
Object {

0 commit comments

Comments
 (0)