graphql-engine/server/tests-py/queries/remote_schemas/permissions
Antoine Leblanc 81d9071948 Fix remote relationship invalid type name issue (fix hasura/graphql-engine#8002)
## Description

When setting up a remote relationship to a remote schema, values coming from the left-hand side are given as _arguments_ to the targeted field of the remote schema. In turn, that means we need to adjust the arguments to that remote field; in the case of input objects, it means creating a brand new input object in which the relevant fields have been removed.

To both avoid conflicts, and be explicit, we give a pretty verbose name to such an input object: its original name, followed by "remote_rel", followed by the full name of the field (table name + relationship name). The bug there was introduced when working on extending remote relationships to other backends: we changed the code that translates the table name to a graphql identifier to be generic, and use the table's `ToTxt` instance instead. However, when a table is not in the default schema, the character used by that instance is `.`, which is not a valid GraphQL name.

This PR fixes it, by doing two things:
- it defines a safe function to translate LHS identifiers to graphql names (by replacing all invalid characters by `_`)
- it doesn't use `unsafeMkName` anymore, and checks at validation time that the type name is correct

## Further work

On this PR:
- [x] add a test
- [x] write a Changelog entry

Beyond this PR, we might want to:
- prioritize #1747
- analyze all calls to `unsafeMkName` and remove as many as possible

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/3363
GitOrigin-RevId: fe98eb1d34157b2c8323af453f5c369de616af38
2022-01-27 14:34:01 +00:00
..
argument_presets server: rewrite remote input parsers to deal with partial variable expansion (fix hasura/graphql-engine#6656) 2021-05-24 20:13:47 +00:00
inheritance server: inherited roles for mutations, remote schemas, actions and custom functions 2021-08-09 10:21:05 +00:00
remote_relationships Fix remote relationship invalid type name issue (fix hasura/graphql-engine#8002) 2022-01-27 14:34:01 +00:00
schema_customization Remote Schema Customization take 2 using parser tranformations 2021-07-30 11:33:59 +00:00
update_remote_schema server, console, docs: add update_remote_schema API 2021-06-21 17:42:40 +00:00
add_permission_with_dangling_fields.yaml Merge pull request #113 from hasura/karthikeyan/remote-schema-permissions 2020-12-21 09:12:35 +00:00
add_permission_with_valid_subset_of_arguments.yaml Merge pull request #113 from hasura/karthikeyan/remote-schema-permissions 2020-12-21 09:12:35 +00:00
add_permission_with_valid_subset_of_fields.yaml Merge pull request #113 from hasura/karthikeyan/remote-schema-permissions 2020-12-21 09:12:35 +00:00
argument_preset_validation.yaml server: move remote schema permissions APIs to /v1/metadata 2021-01-18 10:39:29 +00:00
execution_with_partial_args_exposed_to_role.yaml Merge pull request #113 from hasura/karthikeyan/remote-schema-permissions 2020-12-21 09:12:35 +00:00
execution_with_partial_fields_exposed_to_role_cached.yaml Adds integration test for caching remote schema queries 2021-06-22 21:11:02 +00:00
execution_with_partial_fields_exposed_to_role.yaml Merge pull request #113 from hasura/karthikeyan/remote-schema-permissions 2020-12-21 09:12:35 +00:00
role_based_schema_enum_validations.yaml server: move remote schema permissions APIs to /v1/metadata 2021-01-18 10:39:29 +00:00
role_based_schema_input_object_validation.yaml server: fix empty remote input objects (fixes #6029, #6703) 2021-04-21 01:17:01 +00:00
role_based_schema_interface_validation.yaml server: move remote schema permissions APIs to /v1/metadata 2021-01-18 10:39:29 +00:00
role_based_schema_object_validation.yaml server: fix empty remote input objects (fixes #6029, #6703) 2021-04-21 01:17:01 +00:00
role_based_schema_scalar_validation.yaml server: move remote schema permissions APIs to /v1/metadata 2021-01-18 10:39:29 +00:00
role_based_schema_union_validation.yaml server: move remote schema permissions APIs to /v1/metadata 2021-01-18 10:39:29 +00:00
setup.yaml Merge pull request #113 from hasura/karthikeyan/remote-schema-permissions 2020-12-21 09:12:35 +00:00
teardown.yaml Merge pull request #113 from hasura/karthikeyan/remote-schema-permissions 2020-12-21 09:12:35 +00:00
unknown_role_execution.yaml Merge pull request #113 from hasura/karthikeyan/remote-schema-permissions 2020-12-21 09:12:35 +00:00