graphql-engine/server/tests-py/queries/actions/sync/expecting_object_response.yaml
Rakesh Emmadi 6f100e0009
improve debug information in actions errors response (close #4031) (#4432)
* config options for internal errors for non-admin role, close #4031

More detailed action debug info is added in response 'internal' field

* add docs

* update CHANGELOG.md

* set admin graphql errors option in ci tests, minor changes to docs

* fix tests

Don't use any auth for sync actions error tests. The request body
changes based on auth type in session_variables (x-hasura-auth-mode)

* Apply suggestions from code review

Co-Authored-By: Marion Schleifer <marion@hasura.io>

* use a new sum type to represent the inclusion of internal errors

As suggested in review by @0x777
-> Move around few modules in to specific API folder
-> Saperate types from Init.hs

* fix tests

Don't use any auth for sync actions error tests. The request body
changes based on auth type in session_variables (x-hasura-auth-mode)

* move 'HttpResponse' to 'Hasura.HTTP' module

* update change log with breaking change warning

* Update CHANGELOG.md

Co-authored-by: Marion Schleifer <marion@hasura.io>
Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
2020-04-24 13:25:51 +05:30

84 lines
2.0 KiB
YAML

- description: Update actions webhook to another route which retuns array response
url: /v1/query
status: 200
response:
message: success
query:
type: update_action
args:
name: create_user
definition:
kind: synchronous
arguments:
- name: users
type: '[UserInput!]!'
output_type: UserId
handler: http://127.0.0.1:5593/create-users
- description: Run create_users sync action
url: /v1/graphql
status: 200
query:
query: |
mutation {
create_user(users: [{email: "blake@hasura.io", name: "Blake"}, {email: "elsa@hasura.io", name: "Elsa"}]){
id
user {
name
email
is_admin
}
}
}
response:
errors:
- extensions:
internal:
error: unexpected response
response:
status: 200
body:
- id: 1
- id: 2
headers:
- value: application/json
name: Content-Type
- value: abcd
name: Set-Cookie
request:
body:
session_variables:
x-hasura-role: admin
input:
users:
- email: blake@hasura.io
name: Blake
- email: elsa@hasura.io
name: Elsa
action:
name: create_user
url: http://127.0.0.1:5593/create-users
headers: []
path: $
code: unexpected
message: expecting object for action webhook response but got array
- description: Revert action definition
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