Schema name is not part of graphql query after "Custom GraphQL Root Fields" is used on a table #7392
-
After you use "Custom GraphQL Root Fields" for table name then in graphql query schema name is not added just that alias. So for example schema name is "pets" and I rename table "new_cats" to just "cats" then in graphql query I have to query "cats_connection" instead of "pets_cats_connection". |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@nizamani - This is currently the expected behaviour. When you are using custom GraphQL root fields, Hasura replaces the auto-generated name with exactly what you give as input for the custom field name. So if you would like to retain the schema prefix, currently it needs to be given as part of the input. So your rename to cats will have This is to ensure that in cases where you actually don't want the schema prefix for some reason, you still have total control over what needs to be exposed. Although I agree that the console UI currently shows the field names without the prefix as a default input placeholder and that might be confusing. It should show the exact field name being used by Hasura. |
Beta Was this translation helpful? Give feedback.
@nizamani - This is currently the expected behaviour. When you are using custom GraphQL root fields, Hasura replaces the auto-generated name with exactly what you give as input for the custom field name. So if you would like to retain the schema prefix, currently it needs to be given as part of the input. So your rename to cats will have
pets_cats
as the actual input.This is to ensure that in cases where you actually don't want the schema prefix for some reason, you still have total control over what needs to be exposed.
Although I agree that the console UI currently shows the field names without the prefix as a default input placeholder and that might be confusing. It should show the ex…