mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-25 08:24:00 +03:00
81d9071948
## 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 |
||
---|---|---|
.. | ||
permissions | ||
remote_relationships | ||
validation | ||
add_remote_schema_err_missing_arg.yaml | ||
add_remote_schema_err_missing_field.yaml | ||
add_remote_schema_err_unknown_interface.yaml | ||
add_remote_schema_iface_err_wrong_arg_type.yaml | ||
add_remote_schema_with_iface_err_empty_fields_list.yaml | ||
add_remote_schema_with_iface_err_extra_non_null_arg.yaml | ||
add_remote_schema_with_iface_err_wrong_field_type.yaml | ||
add_remote_schema_with_union_err_member_type_interface.yaml | ||
add_remote_schema_with_union_err_no_member_types.yaml | ||
add_remote_schema_with_union_err_unknown_types.yaml | ||
add_remote_schema_with_union_err_wrapped_type.yaml | ||
basic_bulk_remove_add.yaml | ||
basic_query_customized.yaml | ||
basic_query.yaml | ||
basic_subscription_not_supported.yaml | ||
basic_timeout_query.yaml | ||
character_interface_query.yaml | ||
check_resp_headers.yaml | ||
create_conflicting_table.yaml | ||
drop_person_table.yaml | ||
drop_user_table.yaml | ||
person_table.yaml | ||
search_union_type_query.yaml | ||
simple2_mutation.yaml | ||
simple2_query.yaml | ||
tbls_setup.yaml | ||
tbls_teardown.yaml |