graphql-engine/server/tests-py/queries
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
..
actions An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
compression [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
endpoints An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
event_triggers server: fix create event trigger failure on tables with MSSQL reserved keywords as name 2022-06-15 17:11:44 +00:00
explain server: more GHC 9.2 changes compatible with 8.10 (#3550) 2022-07-07 16:51:18 +00:00
graphql_introspection server: postgres multiple updates 2022-07-18 15:16:47 +00:00
graphql_mutation An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
graphql_query An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
graphql_validation An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
heterogeneous [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
horizontal_scale/basic sync metadata cache across multiple instances connected to same db (closes #1182) (#1574) 2019-03-12 11:16:27 +05:30
inconsistent_objects Remove all functions from RQL.Types.hs 2022-04-26 15:13:57 +00:00
logging [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
naming_conventions server: apply naming convention to prefixing/suffixing for graphql-default 2022-07-12 08:34:38 +00:00
openapi Rewrite OpenAPI 2022-06-30 12:57:09 +00:00
query_cache server: disable caching for actions with forward client headers enabled 2021-04-13 07:01:34 +00:00
remote_schemas An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
scheduled_triggers server: fix flaky test_check_events_statuses test 2021-10-22 05:55:59 +00:00
schema/duplication server: Metadata origin for definitions (type parameter version v2) 2022-06-28 15:53:44 +00:00
subscriptions server/postgres: parameterise array variables in queries/subscriptions 2022-06-29 13:37:11 +00:00
unauthorized_role Adding multiple jwt secrets (incorporating provenance requirements) 2022-02-13 23:34:39 +00:00
v1 An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
v2 An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
webhooks/request_context pass gql requests into auth webhook POST body (#149) 2021-02-03 07:11:39 +00:00
clear_db_bigquery.yaml Feature/bigquery python tests 2021-04-22 11:32:55 +00:00
clear_db_citus.yaml server/citus: feature branch 2021-05-21 02:47:51 +00:00
clear_db_mssql.yaml server: generalize integration tests 2021-03-11 18:18:41 +00:00
clear_db.yaml python based tests (#387) 2018-09-18 11:51:57 +05:30