graphql-engine/server/tests-py/queries/endpoints
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
..
endpoint_as_user_err.yaml An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
endpoint_conflicting.yaml server: fix erroneous Eq instance on Metadata Object 2021-07-20 14:24:45 +00:00
endpoint_dropped.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_duplicate_param.yaml server: validate REST endpoint queries after metadata change 2022-02-08 04:47:52 +00:00
endpoint_empty_path_param.yaml server: validate REST endpoint queries after metadata change 2022-02-08 04:47:52 +00:00
endpoint_empty_path_segment.yaml server: validate REST endpoint queries after metadata change 2022-02-08 04:47:52 +00:00
endpoint_empty_path.yaml Inconsistent metadata support for REST endpoints 2021-03-10 05:26:10 +00:00
endpoint_missing.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_pg_date_url_variable.yaml Fixing URL parameter for variable <name> not supported bug in REST endpoints for Dates 2022-05-02 03:34:34 +00:00
endpoint_query_validation.yaml Rewrite GraphQL.Analysis 2022-04-04 05:54:59 +00:00
endpoint_simple_cached.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_simple_wrong_method.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_simple.yaml server: add tests ensuring the correct functioning of all endpoints based on user roles 2021-07-16 16:09:25 +00:00
endpoint_subscription.yaml server: validate REST endpoint queries after metadata change 2022-02-08 04:47:52 +00:00
endpoint_trailing_slash.yaml server: validate REST endpoint queries after metadata change 2022-02-08 04:47:52 +00:00
endpoint_with_body_arg.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_list_arg.yaml Fixing REST Enpoints list variable bug 2021-12-03 21:57:25 +00:00
endpoint_with_multiple_query_args.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg_missing_arg.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg_url_encoded_2.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg_url_encoded.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_query_arg.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_template.yaml server: support restified versions of graphql queries (#303) 2021-01-29 01:03:35 +00:00
endpoint_with_uuid_arg.yaml REST endpoint uuid param bugfix 2021-05-06 06:44:17 +00:00
setup.yaml Fixing URL parameter for variable <name> not supported bug in REST endpoints for Dates 2022-05-02 03:34:34 +00:00
teardown.yaml Fixing URL parameter for variable <name> not supported bug in REST endpoints for Dates 2022-05-02 03:34:34 +00:00