-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests for simple _or and _and clauses (#40)
tests for simple `_or` and `_and` clauses
- Loading branch information
Showing
7 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
testdata/unit_tests/query_tests/payments/simple_and_clause/ndc_request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"arguments": {}, | ||
"collection": "customers", | ||
"collection_relationships": {}, | ||
"query": { | ||
"fields": { | ||
"customerId": { | ||
"column": "customer_id", | ||
"type": "column" | ||
}, | ||
"email": { | ||
"column": "email", | ||
"type": "column" | ||
}, | ||
"name": { | ||
"column": "name", | ||
"type": "column" | ||
} | ||
}, | ||
"predicate": { | ||
"expressions": [ | ||
{ | ||
"column": { | ||
"type": "column", | ||
"name": "customer_id" | ||
}, | ||
"operator": "term", | ||
"type": "binary_comparison_operator", | ||
"value": { | ||
"type": "scalar", | ||
"value": "CUST005" | ||
} | ||
}, | ||
{ | ||
"column": { | ||
"type": "column", | ||
"name": "email" | ||
}, | ||
"operator": "match", | ||
"type": "binary_comparison_operator", | ||
"value": { | ||
"type": "scalar", | ||
"value": "[email protected]" | ||
} | ||
} | ||
], | ||
"type": "and" | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
testdata/unit_tests/query_tests/payments/simple_and_clause/query.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
query MyQuery { | ||
customers( | ||
where: { | ||
_and: [ | ||
{ customerId: {term: "CUST005"} }, | ||
{ email: {match: "[email protected]"} } | ||
] | ||
}) { | ||
customerId | ||
name | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
testdata/unit_tests/query_tests/payments/simple_and_clause/want.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"_source": [ | ||
"customer_id", | ||
"email", | ||
"name" | ||
], | ||
"query": { | ||
"bool": { | ||
"must": [ | ||
{ | ||
"term": { | ||
"customer_id": "CUST005" | ||
} | ||
}, | ||
{ | ||
"match": { | ||
"email": "[email protected]" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"size": 10000 | ||
} |
50 changes: 50 additions & 0 deletions
50
testdata/unit_tests/query_tests/payments/simple_or_clause/ndc_request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"arguments": {}, | ||
"collection": "customers", | ||
"collection_relationships": {}, | ||
"query": { | ||
"fields": { | ||
"customerId": { | ||
"column": "customer_id", | ||
"type": "column" | ||
}, | ||
"email": { | ||
"column": "email", | ||
"type": "column" | ||
}, | ||
"name": { | ||
"column": "name", | ||
"type": "column" | ||
} | ||
}, | ||
"predicate": { | ||
"expressions": [ | ||
{ | ||
"column": { | ||
"type": "column", | ||
"name": "customer_id" | ||
}, | ||
"operator": "term", | ||
"type": "binary_comparison_operator", | ||
"value": { | ||
"type": "scalar", | ||
"value": "CUST005" | ||
} | ||
}, | ||
{ | ||
"column": { | ||
"type": "column", | ||
"name": "customer_id" | ||
}, | ||
"operator": "term", | ||
"type": "binary_comparison_operator", | ||
"value": { | ||
"type": "scalar", | ||
"value": "CUST006" | ||
} | ||
} | ||
], | ||
"type": "or" | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
testdata/unit_tests/query_tests/payments/simple_or_clause/query.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
query MyQuery { | ||
customers(where: { | ||
_or: [ | ||
{ customerId: {term: "CUST005"} }, | ||
{ customerId: {term: "CUST006"} } | ||
] | ||
}) { | ||
customerId | ||
name | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
testdata/unit_tests/query_tests/payments/simple_or_clause/want.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"_source": [ | ||
"customer_id", | ||
"email", | ||
"name" | ||
], | ||
"query": { | ||
"bool": { | ||
"should": [ | ||
{ | ||
"term": { | ||
"customer_id": "CUST005" | ||
} | ||
}, | ||
{ | ||
"term": { | ||
"customer_id": "CUST006" | ||
} | ||
} | ||
] | ||
} | ||
}, | ||
"size": 10000 | ||
} |