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.06k stars 2.77k forks source link

Support GraphQL endpoints for event trigger webhooks #2137

Open leoalves opened 5 years ago

leoalves commented 5 years ago

Having the ability to call GraphQL endpoints from Webhooks would be very useful, IMO.

Today, I have a few validations and business logic that are not supported by Hasura. I am using the Remote Schema to validate those. Which is great.

But when listening to database changes, Webhooks, I need to have one endpoint for each trigger. And that changes the mindset, a bit. And I need to figure out the function that is going to be called, etc...

Since everything else is GraphQL I think it would make sense to also allow webhooks to call GraphQL endpoints. We could add the mutation, and specify the table fields that goes into the variables, or all fields from the table could go into the variables.

Something like this image:

image

Thanks

ManUtopiK commented 5 years ago

I love this idea! If it can make introspection to the webhook graphql endpoint, it can display a graphqli explorer of this endpoint instead of the Mutation field. Whatever, why limit to Mutation only? Maybe it could be useful to query another endpoint with variables? And could we call current hasura graphql endpoint him-self ? How to prevent inception loop? This is blow my mind 😉

mnlbox commented 5 years ago

@rikinsk, @marionschleifer Any progress on this?

marionschleifer commented 4 years ago

This issue has been promoted to RFC candidate which means it's something that we would like to work on. The next step for us is to prioritise it for our product roadmap and work on a spec. We'll inform here when there's an update 🙂