hasura / graphql-engine

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.
https://hasura.io
Apache License 2.0
31.17k stars 2.76k forks source link

Feature Request: Action Relationship from table to action #6557

Open fi0 opened 3 years ago

fi0 commented 3 years ago

Action relationship can be created from an action to a local table. Please also add support for creating a relationship from a local table to an action.

For instance, An action accepts user_id as the input and return the first_name. A local table includes a list of user_id. And I'd like hasura to return a list of users that contain both user_id and first_name.

esseswann commented 3 years ago

This functionality is available through Remote Schemas

fi0 commented 3 years ago

It would be nice if non-GraphQL endpoints are also supported. Or do you recommend using Remote Schemas with GraphQL in this case?

esseswann commented 3 years ago

Yes, you can create a relationship from your Hasura table to a Remote schema and it will automatically map corresponding entries https://hasura.io/blog/remote-joins-a-graphql-api-to-join-database-and-other-data-sources/