Skip to content

Commit

Permalink
allow platform specific diffs in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
olirice committed Feb 3, 2025
1 parent 062a52a commit 26a6bf6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 24 deletions.
25 changes: 17 additions & 8 deletions test/expected/resolve_error_from_parser.out
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
select graphql.resolve($$
{ { {
shouldFail
-- Platform specific diffs so we have to test the properties here rather than exact response
with d(val) as (
select graphql.resolve($$
{ { {
shouldFail
}
}
}
$$);
resolve
-------------------------------------------------------------------------------------------------------------------
{"errors": [{"message": "query parse error: Parse error at 2:3\nUnexpected `{[Punctuator]`\nExpected `Name`\n"}]}
$$)::json
)
select
(
json_typeof(val -> 'errors') = 'array'
and json_array_length(val -> 'errors') = 1
) as is_valid
from d;
is_valid
----------
t
(1 row)

8 changes: 0 additions & 8 deletions test/expected/test_error_parsing.out

This file was deleted.

20 changes: 15 additions & 5 deletions test/sql/resolve_error_from_parser.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
select graphql.resolve($$
{ { {
shouldFail
-- Platform specific diffs so we have to test the properties here rather than exact response
with d(val) as (
select graphql.resolve($$
{ { {
shouldFail
}
}
}
$$);
$$)::json
)

select
(
json_typeof(val -> 'errors') = 'array'
and json_array_length(val -> 'errors') = 1
) as is_valid
from d;
3 changes: 0 additions & 3 deletions test/sql/test_error_parsing.sql

This file was deleted.

0 comments on commit 26a6bf6

Please sign in to comment.