Skip to content

How to change database schema and have queries/mutations still work? #7198

Discussion options

You must be logged in to vote

IMO this is one of the issues with Hasura. The API is coupled with the database structure. Changes to the database will automatically change your API.

To do what you want you will need to use the metadata API to add custom_root_fields
https://hasura.io/docs/latest/graphql/core/api-reference/metadata-api/table-view.html#pg-track-table

I don't think you can have multiple values for the custom_root_fields. You can change the database structure and remap using it but you can't have 2 different graphql-engines connected to the same database with different metadata.

I know this is something Hasura was going to add to their cloud product. I don't use the cloud so I am not sure if that was added …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@andrewbeckman
Comment options

Answer selected by Adron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants