graphql-engine/server/tests-py/queries/graphql_query/functions
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
..
permissions An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
alter_function_error.yaml don't allow altering tracked SQL functions type to VOLATILE (fix #1546) (#1547) 2019-02-05 11:27:03 +05:30
overloading_function_error.yaml do not allow overloading already tracked functions (#1563) 2019-02-14 09:35:18 +05:30
query_get_session_var.yaml functions can access session info via input arg (close #2322) (#3143) 2019-11-20 12:17:06 +05:30
query_get_test_session_id.yaml server: support tracking of custom functions which return single row 2021-02-03 14:07:30 +00:00
query_get_test_uuid.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
query_get_users_arguments_error.yaml use named notation for function arguments if any argument is not specified (fix #2730) (#2777) 2019-08-28 14:27:15 -05:00
query_get_users_default_arguments_error.yaml use named notation for function arguments if any argument is not specified (fix #2730) (#2777) 2019-08-28 14:27:15 -05:00
query_get_users.yaml use named notation for function arguments if any argument is not specified (fix #2730) (#2777) 2019-08-28 14:27:15 -05:00
query_my_add.yaml support null and default values for function arguments (close #2176, close #2250) (#2282) 2019-06-04 18:13:28 +05:30
query_search_author_mview.yaml server: fix issue with tracking custom functions that return SETOF materialized view (close #5294) (#5945) 2020-10-22 13:26:42 +00:00
query_search_posts_aggregate.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
query_search_posts.yaml An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
setup.yaml server: support adding a tracked function as a computed field and vice versa 2021-05-20 06:29:24 +00:00
teardown.yaml server: fix issue with tracking custom functions that return SETOF materialized view (close #5294) (#5945) 2020-10-22 13:26:42 +00:00
track_customised_names.yaml An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
track_function_v2_errors.yaml server: include more detail in inconsistent metadata error messages (fix #6684) 2021-05-19 05:02:53 +00:00
track_non_base_function_arg_type.yaml server: fix bug when executing a custom function with a row type argument 2021-05-06 09:19:49 +00:00