Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q: Graph-node subscriptions #3647

Closed
Jacob273 opened this issue Jun 9, 2022 · 5 comments
Closed

Q: Graph-node subscriptions #3647

Jacob273 opened this issue Jun 9, 2022 · 5 comments

Comments

@Jacob273
Copy link
Contributor

Jacob273 commented Jun 9, 2022

Q: Is there any way to subscribe (e.g via websocket) for event (eth contract's event) which is handled in subgraph/graph-node?

  1. Let's say we have following event defined in subgraph.yaml under eventhandlers.event:
    - event: Transfer(indexed address,indexed address,indexed uint256)
    handler: handleTransfer

  2. Such event ( Transfer(indexed address,indexed address,indexed uint256) ) is also defined in contract's ABI (and so it is published by eth network).

Is there any way to subscribe for it directly via graph-node, so that every transfer which results in saving some data/entity in graph-node and which we may query for will be immediately published? Or does this kind of publishing logic has to be included in the event handler? (or as I understood its subgraph which shall define type Subscription in its schema.graphql, so we may then listen for it through graph-node, yes?)

I would like to not have to make any kind of polling and get real-time data from the graph-node when it does save data/entities.

@Jacob273
Copy link
Contributor Author

Jacob273 commented Jun 9, 2022

Is there any example/doc regarding how we may subscribe through GRAPH-QL-WS?
I've managed to connect to graphql-ws for one of the subgraphs but I did not manage to subscribe for anything.

@Jacob273
Copy link
Contributor Author

I'll close it as there's no activity.

@khuepm
Copy link

khuepm commented Sep 21, 2022

Same here, may be websocket is not implement.

@eldimious
Copy link

Hello, is there any documentation for the above one? Cause i would like to use graphql subscriptions to subscribe to entities changes when events are emitted and handlers modify entities, instead of using graphql polling

@lutter
Copy link
Collaborator

lutter commented Apr 6, 2025

This is now moot as subscriptions are no longer supported

@lutter lutter closed this as completed Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants