graphql-engine/server/tests-py/queries/graphql_query/basic
Samir Talwar eab4f75212 An ErrorMessage type, to encapsulate.
This introduces an `ErrorMessage` newtype which wraps `Text` in a manner which is designed to be easy to construct, and difficult to deconstruct.

It provides functionality similar to `Data.Text.Extended`, but designed _only_ for error messages. Error messages are constructed through `fromString`, concatenation, or the `toErrorValue` function, which is designed to be overridden for all meaningful domain types that might show up in an error message. Notably, there are not and should never be instances of `ToErrorValue` for `String`, `Text`, `Int`, etc. This is so that we correctly represent the value in a way that is specific to its type. For example, all `Name` values (from the _graphql-parser-hs_ library) are single-quoted now; no exceptions.

I have mostly had to add `instance ToErrorValue` for various backend types (and also add newtypes where necessary). Some of these are not strictly necessary for this changeset, as I had bigger aspirations when I started. These aspirations have been tempered by trying and failing twice.

As such, in this changeset, I have started by introducing this type to the `parseError` and `parseErrorWith` functions. In the future, I would like to extend this to the `QErr` record and the various `throwError` functions, but this is a much larger task and should probably be done in stages.

For now, `toErrorMessage` and `fromErrorMessage` are provided for conversion to and from `Text`, but the intent is to stop exporting these once all error messages are converted to the new type.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5018
GitOrigin-RevId: 84b37e238992e4312255a87ca44f41af65e2d89a
2022-07-18 20:27:06 +00:00
..
author_with_permission_mssql.yaml Parse session variables to their correct type in mssql 2021-11-20 09:03:44 +00:00
nested_select_with_foreign_key_alter.yaml better change detection when altering foreign key constraints (fix #2060) (#2252) 2019-06-03 15:51:55 +05:30
nodes_aggregates_conditions_mssql.yaml server/mssql: restrict "count" aggregate query on multiple columns 2022-01-18 14:54:46 +00:00
nodes_aggregates_mssql.yaml MSSQL: __typename error and json based aggregates (graphql-engine#7130) 2021-07-30 09:03:57 +00:00
schema_setup_citus.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
schema_setup_mssql.yaml MSSQL nodes aggregates & inherited roles 2021-07-08 20:50:09 +00:00
schema_teardown_citus.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
schema_teardown_mssql.yaml MSSQL nodes aggregates & inherited roles 2021-07-08 20:50:09 +00:00
select_multiple_columns_arr_fkey.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
select_multiple_columns_obj_fkey.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
select_placeholder_err.yaml An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
select_query_author_v1alpha1.yaml server/bigquery: improve test setup and documentation (close #2345) 2021-10-12 17:59:44 +00:00
select_query_batching_with_mutation.yaml Report errors in parallel when batching (#3605) 2019-12-30 17:18:20 -06:00
select_query_batching_with_one_error.yaml An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
select_query_batching.yaml Support batched queries (fix #1812) (#3490) 2019-12-20 10:04:02 -06:00
select_query_fragment_cycles.yaml Rewrite GraphQL schema generation and query parsing (close #2801) (#4111) 2020-08-21 12:27:01 -05:00
select_query_fragment_with_variable.yaml server: allow fragments to use variables (fix hasura/graphql-engine#6303) (#225) 2020-12-22 10:42:34 +00:00
select_query_invalid_escape_sequence.yaml capture Postgres error code 22025 as HTTP 400 bad request (close #2486) (#2671) 2019-08-08 15:57:42 -05:00
select_query_nested_fragment.yaml Add tests for directives skip and include and basic tests for fragments (fix #3180) (#3185) 2019-10-20 06:59:41 -05:00
select_query_person_citext.yaml fix casting citext column type (fix #2818) (#3861) 2020-02-11 16:02:13 +05:30
select_query_test_types_mssql.yaml server: generalize integration tests 2021-03-11 18:18:41 +00:00
select_query_test_types_postgres.yaml server: generalize integration tests 2021-03-11 18:18:41 +00:00
select_query_top_level_fragment.yaml Add tests for directives skip and include and basic tests for fragments (fix #3180) (#3185) 2019-10-20 06:59:41 -05:00
select_query_user_col_change_mssql.yaml server: split TestGraphQLQueryBasic into common and backend-specific test classes 2021-03-16 16:42:20 +00:00
select_query_user_col_change_postgres.yaml server: split TestGraphQLQueryBasic into common and backend-specific test classes 2021-03-16 16:42:20 +00:00
select_query_user_mssql.yaml server: split TestGraphQLQueryBasic into common and backend-specific test classes 2021-03-16 16:42:20 +00:00
select_query_user_postgres.yaml server: split TestGraphQLQueryBasic into common and backend-specific test classes 2021-03-16 16:42:20 +00:00
setup_citus.yaml server: improve backend-specific test setup 2021-05-25 13:55:11 +00:00
setup_invalid_fkey_relationship.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
setup_mssql.yaml Parse session variables to their correct type in mssql 2021-11-20 09:03:44 +00:00
setup.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
teardown_citus.yaml server: improve backend-specific test setup 2021-05-25 13:55:11 +00:00
teardown_mssql.yaml MSSQL nodes aggregates & inherited roles 2021-07-08 20:50:09 +00:00
teardown.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00