graphql-engine/server/tests-py/queries/actions/sync
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
..
remote_joins [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
create_user_fail.yaml server: async action query subscription 2021-03-31 10:40:15 +00:00
create_user_relationship_fail.yaml An ErrorMessage type, to encapsulate. 2022-07-18 20:27:06 +00:00
create_user_relationship.yaml Fix action relationship type and input arguments (closes #6402) (#284) 2021-01-18 06:57:24 +00:00
create_user_success.yaml auto-include __typename field in custom types' objects (fix #4063) (#4074) 2020-03-11 17:09:00 +05:30
create_users_fail.yaml server: async action query subscription 2021-03-31 10:40:15 +00:00
create_users_success.yaml auto-include __typename field in custom types' objects (fix #4063) (#4074) 2020-03-11 17:09:00 +05:30
expecting_array_response_got_null.yaml server: Support returning scalar types in actions 2022-02-15 14:40:34 +00:00
expecting_array_response.yaml server: Adds support to return array of scalars in Actions 2022-05-31 05:23:47 +00:00
expecting_custom_scalar_array_response_success.yaml server: add support for custom scalar in action output types 2022-06-03 09:48:26 +00:00
expecting_custom_scalar_response_success.yaml server: add support for custom scalar in action output types 2022-06-03 09:48:26 +00:00
expecting_jsonb_response_success.yaml server: add support for custom scalar in action output types 2022-06-03 09:48:26 +00:00
expecting_object_response_got_null.yaml server: Support returning scalar types in actions 2022-02-15 14:40:34 +00:00
expecting_object_response_got_scalar.yaml server: Support returning scalar types in actions 2022-02-15 14:40:34 +00:00
expecting_object_response_with_nested_null.yaml don't drop nested typed null fields in actions (fix #8237) 2022-04-18 09:59:16 +00:00
expecting_object_response.yaml server: Adds support to return array of scalars in Actions 2022-05-31 05:23:47 +00:00
expecting_scalar_response_got_object.yaml server: Adds support to return array of scalars in Actions 2022-05-31 05:23:47 +00:00
extensions_code_both_codes.yaml server: add "extensions" field to action webhook error schema 2021-09-17 07:44:37 +00:00
extensions_code_nothing.yaml server: add "extensions" field to action webhook error schema 2021-09-17 07:44:37 +00:00
extensions_code_only_empty_extensions.yaml server: add "extensions" field to action webhook error schema 2021-09-17 07:44:37 +00:00
extensions_code_only_extensions_code.yaml server: add "extensions" field to action webhook error schema 2021-09-17 07:44:37 +00:00
extensions_code_toplevel_empty_extensions.yaml server: add "extensions" field to action webhook error schema 2021-09-17 07:44:37 +00:00
extensions_code_toplevel_no_extensions.yaml server: add "extensions" field to action webhook error schema 2021-09-17 07:44:37 +00:00
get_null_field_expecting_non_nullable_field_array.yaml server: Adds support to return array of scalars in Actions 2022-05-31 05:23:47 +00:00
get_scalar_action_output_type_success.yaml server: Support returning scalar types in actions 2022-02-15 14:40:34 +00:00
get_string_scalar_array_action_output_type_expecting_number_array.yaml server: Adds support to return array of scalars in Actions 2022-05-31 05:23:47 +00:00
get_string_scalar_array_action_output_type_success.yaml server: Adds support to return array of scalars in Actions 2022-05-31 05:23:47 +00:00
get_user_by_email_fail.yaml server(actions): add support for queries (close #4032) (#4309) 2020-04-16 12:55:19 +05:30
get_user_by_email_nested_join_success.yaml Nested action joins 2022-03-03 03:44:20 +00:00
get_user_by_email_nested_success.yaml don't drop nested typed null fields in actions (fix #8237) 2022-04-18 09:59:16 +00:00
get_user_by_email_success.yaml fix intermittent errors occur when query actions used with variables (#4527) 2020-04-24 11:39:00 +05:30
get_users_by_email_success.yaml server(actions): add support for queries (close #4032) (#4309) 2020-04-16 12:55:19 +05:30
mirror_action_no_field.yaml Include transformed request in errors 2021-10-13 00:29:49 +00:00
mirror_action_not_null.yaml Include transformed request in errors 2021-10-13 00:29:49 +00:00
mirror_action_success.yaml few actions' fixes and improvements (fix #3977, #4061 & close #4021) (#4109) 2020-03-20 12:16:45 +05:30
mirror_action_transformed_output_success.yaml Feature/webhook response transforms 2022-01-19 04:47:36 +00:00
mirror_action_transformed_success.yaml Request Transformations 2021-09-16 11:03:57 +00:00
mirror_action_unexpected_field.yaml Ignore unexpected fields in action responses 2021-09-29 09:54:36 +00:00
null_response.yaml [server] Allow Nullable action response 2021-10-11 06:56:01 +00:00
object_response_action_transformed_output.yaml server: Support returning scalar types in actions 2022-02-15 14:40:34 +00:00
query_action_recursive_output.yaml server: add support for nested object type in action 2021-12-15 23:52:43 +00:00
query_action_relationship_with_permission.yaml Server: fix query actions issue used with relationship and configured with permissions 2021-01-12 12:04:21 +00:00
results_list_transformed_output_success.yaml Feature/webhook response transforms 2022-01-19 04:47:36 +00:00
scalar_response_action_transformed_output.yaml server: Support returning scalar types in actions 2022-02-15 14:40:34 +00:00
schema_setup.yaml server: add support for custom scalar in action output types 2022-06-03 09:48:26 +00:00
schema_teardown.yaml server: add support for custom scalar in action output types 2022-06-03 09:48:26 +00:00
values_teardown.yaml allow custom mutations through actions (#3042) 2020-02-13 23:08:23 +05:30