mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-21 06:21:39 +03:00
3ea611f9fd
* [skip ci] use the args while making the fieldParser * modify the execution part of the remote queries * parse union queries deeply * add test for remote schema field validation * add tests for validating remote query arguments Co-authored-by: Auke Booij <auke@hasura.io> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
69 lines
1.6 KiB
YAML
69 lines
1.6 KiB
YAML
- description: query the remote with a non-existing field 'non_existing_field', which should fail to validate
|
|
url: /v1/graphql
|
|
status: 200
|
|
query:
|
|
query: |
|
|
query {
|
|
user (id: 1) {
|
|
id
|
|
username
|
|
non_existing_field
|
|
}
|
|
}
|
|
response:
|
|
errors:
|
|
- extensions:
|
|
path: $.selectionSet.user.selectionSet.non_existing_field
|
|
code: validation-failed
|
|
message: "field \"non_existing_field\" not found in type: 'User'"
|
|
|
|
- description: query the remote with a non-existing field in an interface type
|
|
url: /v1/graphql
|
|
status: 200
|
|
query:
|
|
query: |
|
|
{
|
|
hero(episode: 4) {
|
|
id
|
|
name
|
|
... on Droid {
|
|
id
|
|
name
|
|
primaryFunction
|
|
non_existing_field
|
|
}
|
|
}
|
|
}
|
|
response:
|
|
errors:
|
|
- extensions:
|
|
path: $.selectionSet.hero.selectionSet.non_existing_field
|
|
code: validation-failed
|
|
message: "field \"non_existing_field\" not found in type: 'Droid'"
|
|
|
|
- description: query the remote with a non-existing field in an union type
|
|
url: /v1/graphql
|
|
status: 200
|
|
query:
|
|
query: |
|
|
{
|
|
search(episode: 2) {
|
|
__typename
|
|
... on Droid {
|
|
id
|
|
name
|
|
}
|
|
... on Human {
|
|
id
|
|
name
|
|
non_existing_field
|
|
}
|
|
}
|
|
}
|
|
response:
|
|
errors:
|
|
- extensions:
|
|
path: $.selectionSet.search.selectionSet.non_existing_field
|
|
code: validation-failed
|
|
message: "field \"non_existing_field\" not found in type: 'Human'"
|