graphprotocol / graph-node

Graph Node indexes data from blockchains such as Ethereum and serves it over GraphQL
https://thegraph.com
Apache License 2.0
2.91k stars 978 forks source link

Feature request: Webhook for events #3200

Open rafagalan opened 2 years ago

rafagalan commented 2 years ago

Do you want to request a feature or report a bug? Feature

What is the current behavior? Whenever an event is detected the node just executes the mapping.

Desired behavior? It would be nice if the yaml definition had a param to indicate the node to make a request to a given url, this way the node could be integrated with more services giving some users a finer UX.

azf20 commented 2 years ago

Thanks @rafagalan - making sure I understand your use case, you would like to be able to listen for new events? I don't know if it makes sense to bake that into the subgraph definition, but we do definitely want to enable subscription type use cases, where users can subscribe to entity changes cc @dotansimha

Jannis commented 2 years ago

Jepp in mind that there are complications around verifiability with subscriptions. The easiest way is too implement them with polling in the client side. Native GraphQL subscriptions in graph-node exist but are likely a dead end.

rafagalan commented 2 years ago

And is there any estimation on when this (#2953) could be fixed? We will have to stick with polling for the moment, although not ideal.