1010 values
1111 (1, true, 'foo', '1111111111', '{"customer", "priority"}'),
1212 (2, true, 'bar', null, '{"customer"}'),
13- (3, false, 'baz', '33333333333', '{"lead", "priority"}');
13+ (3, false, 'baz', '33333333333', '{"lead", "priority"}'),
14+ (4, false, 'qui', '4585858', null);
1415 savepoint a;
1516 -- Filter by Int
1617 select jsonb_pretty(
@@ -137,6 +138,11 @@ begin;
137138 "node": { +
138139 "id": 3+
139140 } +
141+ }, +
142+ { +
143+ "node": { +
144+ "id": 4+
145+ } +
140146 } +
141147 ] +
142148 } +
@@ -146,17 +152,17 @@ begin;
146152
147153 -- filter = null is ignored
148154 select graphql.resolve($${accountCollection(filter: null) { edges { node { id } } }}$$);
149- resolve
150- -------------------------------------------------------------------------------------------------------------
151- {"data": {"accountCollection": {"edges": [{"node": {"id": 1}}, {"node": {"id": 2}}, {"node": {"id": 3}}]}}}
155+ resolve
156+ ----------------------------------------------------------------------------------------------------------------------------------
157+ {"data": {"accountCollection": {"edges": [{"node": {"id": 1}}, {"node": {"id": 2}}, {"node": {"id": 3}}, {"node": {"id": 4}} ]}}}
152158(1 row)
153159
154160 rollback to savepoint a;
155161 -- neq
156162 select graphql.resolve($${accountCollection(filter: {id: {neq: 2}}) { edges { node { id } } }}$$);
157- resolve
158- ----------------------------------------------------------------------------------------
159- {"data": {"accountCollection": {"edges": [{"node": {"id": 1}}, {"node": {"id": 3}}]}}}
163+ resolve
164+ -------------------------------------------------------------------------------------------------------------
165+ {"data": {"accountCollection": {"edges": [{"node": {"id": 1}}, {"node": {"id": 3}}, {"node": {"id": 4}} ]}}}
160166(1 row)
161167
162168 rollback to savepoint a;
@@ -186,17 +192,17 @@ begin;
186192 rollback to savepoint a;
187193 -- gte
188194 select graphql.resolve($${accountCollection(filter: {id: {gte: 2}}) { edges { node { id } } }}$$);
189- resolve
190- ----------------------------------------------------------------------------------------
191- {"data": {"accountCollection": {"edges": [{"node": {"id": 2}}, {"node": {"id": 3}}]}}}
195+ resolve
196+ -------------------------------------------------------------------------------------------------------------
197+ {"data": {"accountCollection": {"edges": [{"node": {"id": 2}}, {"node": {"id": 3}}, {"node": {"id": 4}} ]}}}
192198(1 row)
193199
194200 rollback to savepoint a;
195201 -- gt
196202 select graphql.resolve($${accountCollection(filter: {id: {gt: 2}}) { edges { node { id } } }}$$);
197- resolve
198- -------------------------------------------------------------------
199- {"data": {"accountCollection": {"edges": [{"node": {"id": 3}}]}}}
203+ resolve
204+ ----------------------------------------------------------------------------------------
205+ {"data": {"accountCollection": {"edges": [{"node": {"id": 3}}, {"node": {"id": 4}} ]}}}
200206(1 row)
201207
202208 rollback to savepoint a;
@@ -210,9 +216,9 @@ begin;
210216 rollback to savepoint a;
211217 -- is - is not null
212218 select graphql.resolve($${accountCollection(filter: {phone: {is: NOT_NULL}}) { edges { node { id } } }}$$);
213- resolve
214- ----------------------------------------------------------------------------------------
215- {"data": {"accountCollection": {"edges": [{"node": {"id": 1}}, {"node": {"id": 3}}]}}}
219+ resolve
220+ -------------------------------------------------------------------------------------------------------------
221+ {"data": {"accountCollection": {"edges": [{"node": {"id": 1}}, {"node": {"id": 3}}, {"node": {"id": 4}} ]}}}
216222(1 row)
217223
218224 rollback to savepoint a;
@@ -412,6 +418,37 @@ begin;
412418(1 row)
413419
414420 rollback to savepoint a;
421+ -- is - array column is NULL/NOT_NULL
422+ select jsonb_pretty(
423+ graphql.resolve($$
424+ {
425+ accountCollection(filter: {tags: {is: NULL}}) {
426+ edges {
427+ node {
428+ id
429+ }
430+ }
431+ }
432+ }
433+ $$)
434+ );
435+ jsonb_pretty
436+ ---------------------------------
437+ { +
438+ "data": { +
439+ "accountCollection": { +
440+ "edges": [ +
441+ { +
442+ "node": { +
443+ "id": 4+
444+ } +
445+ } +
446+ ] +
447+ } +
448+ } +
449+ }
450+ (1 row)
451+
415452 -- variable is - is null
416453 select graphql.resolve($$query AAA($nis: FilterIs) { accountCollection(filter: {phone: {is: $nis}}) { edges { node { id } } }}$$, '{"nis": "NULL"}');
417454 resolve
@@ -422,9 +459,9 @@ begin;
422459 rollback to savepoint a;
423460 -- variable is - absent treated as ignored / returns all
424461 select graphql.resolve($$query AAA($nis: FilterIs) { accountCollection(filter: {phone: {is: $nis}}) { edges { node { id } } }}$$, '{}');
425- resolve
426- -------------------------------------------------------------------------------------------------------------
427- {"data": {"accountCollection": {"edges": [{"node": {"id": 1}}, {"node": {"id": 2}}, {"node": {"id": 3}}]}}}
462+ resolve
463+ ----------------------------------------------------------------------------------------------------------------------------------
464+ {"data": {"accountCollection": {"edges": [{"node": {"id": 1}}, {"node": {"id": 2}}, {"node": {"id": 3}}, {"node": {"id": 4}} ]}}}
428465(1 row)
429466
430467 rollback to savepoint a;
@@ -478,9 +515,9 @@ begin;
478515 rollback to savepoint a;
479516 -- variable in - absent treated as ignored / returns all
480517 select graphql.resolve($$query AAA($nin: [String!]) { accountCollection(filter: {name: {in: $nin}}) { edges { node { id } } }}$$, '{}');
481- resolve
482- -------------------------------------------------------------------------------------------------------------
483- {"data": {"accountCollection": {"edges": [{"node": {"id": 1}}, {"node": {"id": 2}}, {"node": {"id": 3}}]}}}
518+ resolve
519+ ----------------------------------------------------------------------------------------------------------------------------------
520+ {"data": {"accountCollection": {"edges": [{"node": {"id": 1}}, {"node": {"id": 2}}, {"node": {"id": 3}}, {"node": {"id": 4}} ]}}}
484521(1 row)
485522
486523 rollback to savepoint a;
@@ -960,6 +997,11 @@ begin;
960997 "node": { +
961998 "id": 3+
962999 } +
1000+ }, +
1001+ { +
1002+ "node": { +
1003+ "id": 4+
1004+ } +
9631005 } +
9641006 ] +
9651007 } +
0 commit comments