graphql-engine/server/tests-py/queries/graphql_mutation/transactions/transaction_revert_http.yaml
Antoine Leblanc 71ae144aa6 server: implement transaction workaround
GitOrigin-RevId: 404f8bbdefb8a99b31fac75e4253daad81c8af90
2021-04-01 20:41:41 +00:00

53 lines
1.1 KiB
YAML

- description: Insert a value into the table.
url: /v1/graphql
status: 200
response:
data:
insert_author_one:
name: "Rick Astley"
query:
query: |
mutation {
insert_author_one(object: {id: 1, name: "Rick Astley"}) {
name
}
}
- description: Send one valid mutation followed by an erroneous one.
url: /v1/graphql
status: 200
response:
errors:
- extensions:
path: $.selectionSet.insert_author_one.args.object
code: constraint-violation
message: Uniqueness violation. duplicate key value violates unique constraint
"author_pkey"
query:
query: |
mutation {
insert_author(objects: {id: 2, name: "Eduard Anatolyevich Khil"}) {
returning {
name
}
}
insert_author_one(object: {id: 1, name: "Rick Astley"}) {
name
}
}
- description: Check that the first mutation was reverted.
url: /v1/graphql
status: 200
response:
data:
author:
- name: "Rick Astley"
query:
query: |
query {
author {
name
}
}