graphql-engine/server/tests-py/queries/actions/sync/invalid_webhook_response.yaml
Lyndon Maydwell 788e5cb0c2 Include transformed request in errors
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2543
Co-authored-by: Solomon Bothwell <24038+ssbothwell@users.noreply.github.com>
GitOrigin-RevId: 1432a215cfc2c3e8345941b8072925f115f9259f
2021-10-13 00:29:49 +00:00

86 lines
2.1 KiB
YAML

- description: Update actions webhook to another route which retuns non-object/array
response
url: /v1/query
status: 200
response:
message: success
query:
type: update_action
args:
name: create_user
definition:
kind: synchronous
arguments:
- name: email
type: String!
- name: name
type: String!
output_type: UserId
handler: http://127.0.0.1:5593/invalid-response
- description: Run create_user sync action
url: /v1/graphql
status: 200
query:
query: |
mutation {
create_user(email: "clarke@gmail.com", name: "Clarke"){
id
user {
name
email
is_admin
}
}
}
response:
errors:
- extensions:
internal:
error: unexpected response
response:
status: 200
body: some-string
headers:
- value: application/json
name: Content-Type
- value: abcd
name: Set-Cookie
request:
body:
session_variables:
x-hasura-role: admin
input:
email: clarke@gmail.com
name: Clarke
action:
name: create_user
request_query: "mutation {\n create_user(email: \"clarke@gmail.com\", name: \"\
Clarke\"){\n id\n user {\n name\n email\n is_admin\n\
\ }\n }\n}\n"
url: http://127.0.0.1:5593/invalid-response
headers: []
transformed_request:
path: $
code: parse-failed
message: expecting null, object or array of objects for action webhook response
- description: Revert action wehbook
url: /v1/query
status: 200
response:
message: success
query:
type: update_action
args:
name: create_user
definition:
kind: synchronous
arguments:
- name: email
type: String!
- name: name
type: String!
output_type: UserId
handler: http://127.0.0.1:5593/create-user