graphql-engine/server/tests-py/queries/graphql_query/boolexp/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
..
in_sql_identifier_array.yaml Fix new hdb_table_info_agg query to fetch column base types 2020-01-08 16:45:54 -06:00
query_account_permission_fail.yaml allow creating permissions with conditions spanning tables (close #2512) (#2701) 2019-09-05 13:04:53 +05:30
query_account_permission_success.yaml allow creating permissions with conditions spanning tables (close #2512) (#2701) 2019-09-05 13:04:53 +05:30
schema_setup_mssql.yaml server/mssql: support N/IN and N/LIKE operators 2021-03-19 12:43:14 +00:00
schema_teardown_mssql.yaml server: split BoolExpBasic tests into common and backend-specific classes 2021-03-17 10:57:06 +00:00
select_article_author_is_published_and_registered.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
select_article_author_not_published_or_not_registered.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_author_article_operator_ne_not_found_err_mssql.yaml An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
select_author_article_operator_ne_not_found_err_postgres.yaml An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
select_author_article_unexpected_operator_in_where_err_mssql.yaml An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
select_author_article_unexpected_operator_in_where_err_postgres.yaml An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
select_author_article_where_and_in.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
select_author_article_where_gt.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_author_article_where_gte.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_author_article_where_in_empty_array_postgres.yaml server/mssql: support N/IN and N/LIKE operators 2021-03-19 12:43:14 +00:00
select_author_article_where_in.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_author_article_where_lt.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_author_article_where_lte.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_author_article_where_neq.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_author_article_where_nin_empty_array_postgres.yaml server/mssql: support N/IN and N/LIKE operators 2021-03-19 12:43:14 +00:00
select_author_article_where_nin_empty_array.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
select_author_article_where_nin.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_author_article_where_not_lt.yaml Fix result ordering in some incorrect tests 2019-11-05 15:15:25 -06:00
select_author_article_where_permissions.yaml server/bugfix: Include permission filter in the exists clause. Fixes #6931 2021-05-24 09:09:50 +00:00
select_bools_mssql.yaml MSSQL nodes aggregates & inherited roles 2021-07-08 20:50:09 +00:00
select_query_order_delivered_at_is_not_null.yaml server: split BoolExpBasic tests into common and backend-specific classes 2021-03-17 10:57:06 +00:00
select_query_order_delivered_at_is_null.yaml server: split BoolExpBasic tests into common and backend-specific classes 2021-03-17 10:57:06 +00:00
select_uuid_test_in_uuid_col_mssql.yaml server/mssql: support N/IN and N/LIKE operators 2021-03-19 12:43:14 +00:00
select_uuid_test_in_uuid_col_postgres.yaml server/mssql: support N/IN and N/LIKE operators 2021-03-19 12:43:14 +00:00
self_referential_relationships.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
setup_invalid_fkey_relationship_mssql.yaml server: improve backend-specific test setup 2021-05-25 13:55:11 +00:00
setup_mssql.yaml server: improve backend-specific test setup 2021-05-25 13:55:11 +00:00
setup.yaml Revert "Add _cast support for other postgres datatypes fix #6050 and … 2022-06-29 12:09:40 +00:00
teardown_mssql.yaml server: improve backend-specific test setup 2021-05-25 13:55:11 +00:00
teardown.yaml Revert "Add _cast support for other postgres datatypes fix #6050 and … 2022-06-29 12:09:40 +00:00