Hasura recommends relationships, based on foreign keys. So users just can "click" the button to create the relationships like this image.

However, for existing databases with 'many' tables, manually clicking all the buttons is so tedious. Therefore I request a feature to accept EVERY recommended relationships with one click.
If you go to the main "Data" page, it will list all relationships that can be tracked, under "Untracked foreign-key relations". You can just click on the "Track All" button to track them all.

This is what you mean right?
@ecthiender Great! Thank you for letting me know that!
@ecthiender Then what if docs explicitly mention this feature? If so, users would not have to waste their time. Currently, as far as I know, docs doesn't say this feature.
I agree the button "Track All" under "Untracked foreign-key relations" in the the"Data" page is EXTREMELY USEFUL. Otherwise, it would be practically impossible to use Hasura on an existing database with a large number of relationships.
But what is still missing is an API endpoint to do that: "Track all relationships inferred from db structure" (more precisely, the subset of tracked tables).
Is there any plan to add this feature soon ?
Because it really is the ONLY step that cannot be automated (i.e. performed through the API).
You already can:
True, you can create individual relationships though create_array_relationship and create_object_relationship but it is a lot of work to build the many queries to do the same as the "Track All" button on the GUI.
In my company we are starting to use Hasura to expose postgres dBs. Unfortunately this manual step breaks the workflow. I'm surprised this endpoint is not already in the API. I would seem very natural since the work is already done, right ? Is there a reason beyond 'nobody asked for it' ?
Apart from that, I would like to congratulate the Hasura team for the superb work. It is a very useful and promising piece of software !!!
@oscar6echo +1
P.S.0. In my humble opinion, your suggestion should be an independent issue as it's a 'feature request' for API, while this issue is now a 'docs request'.
P.S.1. Using an e2e testing tool would enable a workaround by "clicking" the button in an automatic way.
@oscar6echo It is not encouraged to "click the button" to track all tables or relationships in a production environment. You should do that once in your dev env and then export the metadata and use import this metadata later in other instances.
Otherwise, your configuration is never declarative.
See https://docs.hasura.io/1.0/graphql/manual/migrations/manage-metadata.html on how you can use the API to export/import metadata.
Ok, understood.
Thx for the quick answer.
Closed via #4948
Most helpful comment
If you go to the main "Data" page, it will list all relationships that can be tracked, under "Untracked foreign-key relations". You can just click on the "Track All" button to track them all.
This is what you mean right?