mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-24 16:03:37 +03:00
54e6439579
This fixes an issue where queries could incorrectly be considered reusable if a variable was used in two positions: one where it affected SQL generation and one where it did not.
95 lines
1.6 KiB
YAML
95 lines
1.6 KiB
YAML
-
|
|
description: Insert mutation
|
|
name: insert_hge_tests_test_t2
|
|
query: |
|
|
mutation insert_test_t2($objects: [hge_tests_test_t2_insert_input!]! ) {
|
|
insert_hge_tests_test_t2(objects: $objects) {
|
|
returning {
|
|
c1
|
|
c2
|
|
}
|
|
}
|
|
}
|
|
variables: |
|
|
{
|
|
"objects": [
|
|
{
|
|
"c1": 1,
|
|
"c2": "test1"
|
|
},
|
|
{
|
|
"c1": 2,
|
|
"c2": "test2"
|
|
}
|
|
]
|
|
}
|
|
response: |
|
|
{
|
|
"insert_hge_tests_test_t2": {
|
|
"returning": [
|
|
{
|
|
"c1": 1,
|
|
"c2": "test1"
|
|
},
|
|
{
|
|
"c1": 2,
|
|
"c2": "test2"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
-
|
|
description: Update mutation
|
|
name: update_hge_tests_test_t2
|
|
query: |
|
|
mutation update_test_t2 {
|
|
update_hge_tests_test_t2(
|
|
where: {c1: {_eq: 1}},
|
|
_set: {c2: "test11"}
|
|
) {
|
|
returning {
|
|
c1
|
|
c2
|
|
}
|
|
}
|
|
}
|
|
variables: null
|
|
response: |
|
|
{
|
|
"update_hge_tests_test_t2": {
|
|
"returning": [
|
|
{
|
|
"c1": 1,
|
|
"c2": "test11"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
live_response: |
|
|
[
|
|
{
|
|
"c1": 1,
|
|
"c2": "test11"
|
|
},
|
|
{
|
|
"c1": 2,
|
|
"c2": "test2"
|
|
}
|
|
]
|
|
-
|
|
description: Delete mutation
|
|
name: delete_hge_tests_test_t2
|
|
query: |
|
|
mutation delete_test_t2 {
|
|
delete_hge_tests_test_t2(where: {c1: {_in: [1, 2]}}) {
|
|
affected_rows
|
|
}
|
|
}
|
|
variables: null
|
|
response: |
|
|
{
|
|
"delete_hge_tests_test_t2": {
|
|
"affected_rows": 2
|
|
}
|
|
}
|