graphql-engine/server/tests-py/queries/graphql_introspection
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
..
custom_table_name [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
disable_introspection pro server: disable GraphQL schema introspection for specified roles 2021-05-05 12:26:23 +00:00
nullable_object_relationship server: fix the nullability of object relationships (fix hasura/graphql-engine#7201) 2021-08-26 15:27:34 +00:00
remote_relationships Fix remote relationship invalid type name issue (fix hasura/graphql-engine#8002) 2022-01-27 14:34:01 +00:00
introspection_only_kind_of_queryType.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
introspection_user_role.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
introspection.yaml introduce v1/graphql (fix #1368) (#2064) 2019-05-10 11:35:10 +05:30
setup.yaml [server] coalesce multiple run_sql calls in tests (#270) 2021-01-06 16:07:22 +00:00
teardown.yaml python based tests (#387) 2018-09-18 11:51:57 +05:30