-
Notifications
You must be signed in to change notification settings - Fork 58
feat(graphql): add subscriptions support for events and transactions #8698
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
feat(graphql): add subscriptions support for events and transactions #8698
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 6 Skipped Deployments
|
afd45ad to
3e7e3e5
Compare
tomxey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
do we also plan to add some automated tests for this?
|
During implementation, I did consider adding tests, but our current GraphQL client used for testing setup only supports HTTP requests. Since subscriptions operate over WebSockets, we'd need to:
This would significantly increase the scope of changes and require additional time. We can create a new issue ti tackle this. |
kodemartin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks splendid! Left a few minor comments and nits
66810b3
into
sc-platform/feat/streaming-support
…8698) # Description of change This PR adds the feature to add subscription support for `events` and `transactions` for GraphQL. For filtering capabilities it leverages the [`@oneOf`](https://graphql.org/blog/2025-09-04-multioption-inputs-with-oneof/) directive which does not allow more than one filter at a time for the input filter object. ## Links to any relevant issues fixes #8561 ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - ran graphql tests ```shell cargo nextest run -p iota-graphql-rpc --features pg_integration --no-fail-fast --test-threads 1 ``` - used the iota binary to spin up an indexer and graphql instance and test the subscription queries ``` cargo r --features indexer -- start --force-regenesis --with-indexer --with-graphql ``` - used the integrated graphiQL ui to issue subscription queries - used a third party graphql client (Postman) to issue the same queries > [!NOTE] > At approximately 1k subscribers, the local machine reached its operational limit. The sheer intensity and concurrent demand of managing the network, indexer, GraphQL server, and a high volume of WebSocket connections prevented reliable testing. In future iteration we could add **Prometheus** metrics to track the total amount of active subscribers, how many subscribers experience lags, ect... ### Infrastructure QA (only required for crates that are maintained by @iotaledger/infrastructure) - [ ] Synchronization of the indexer from genesis for a network including migration objects. - [ ] Restart of indexer synchronization locally without resetting the database. - [ ] Restart of indexer synchronization on a production-like database. - [ ] Deployment of services using Docker. - [ ] Verification of API backward compatibility. > [!NOTE] > The following patch does not affect the normal operation of the indexer, thus tests were skipped. ### Release Notes - [x] GraphQL: Add `Subscription` support for `Event` and `TransactionBlock`.
…8698) # Description of change This PR adds the feature to add subscription support for `events` and `transactions` for GraphQL. For filtering capabilities it leverages the [`@oneOf`](https://graphql.org/blog/2025-09-04-multioption-inputs-with-oneof/) directive which does not allow more than one filter at a time for the input filter object. ## Links to any relevant issues fixes #8561 ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - ran graphql tests ```shell cargo nextest run -p iota-graphql-rpc --features pg_integration --no-fail-fast --test-threads 1 ``` - used the iota binary to spin up an indexer and graphql instance and test the subscription queries ``` cargo r --features indexer -- start --force-regenesis --with-indexer --with-graphql ``` - used the integrated graphiQL ui to issue subscription queries - used a third party graphql client (Postman) to issue the same queries > [!NOTE] > At approximately 1k subscribers, the local machine reached its operational limit. The sheer intensity and concurrent demand of managing the network, indexer, GraphQL server, and a high volume of WebSocket connections prevented reliable testing. In future iteration we could add **Prometheus** metrics to track the total amount of active subscribers, how many subscribers experience lags, ect... ### Infrastructure QA (only required for crates that are maintained by @iotaledger/infrastructure) - [ ] Synchronization of the indexer from genesis for a network including migration objects. - [ ] Restart of indexer synchronization locally without resetting the database. - [ ] Restart of indexer synchronization on a production-like database. - [ ] Deployment of services using Docker. - [ ] Verification of API backward compatibility. > [!NOTE] > The following patch does not affect the normal operation of the indexer, thus tests were skipped. ### Release Notes - [x] GraphQL: Add `Subscription` support for `Event` and `TransactionBlock`.
…8698) # Description of change This PR adds the feature to add subscription support for `events` and `transactions` for GraphQL. For filtering capabilities it leverages the [`@oneOf`](https://graphql.org/blog/2025-09-04-multioption-inputs-with-oneof/) directive which does not allow more than one filter at a time for the input filter object. ## Links to any relevant issues fixes #8561 ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - ran graphql tests ```shell cargo nextest run -p iota-graphql-rpc --features pg_integration --no-fail-fast --test-threads 1 ``` - used the iota binary to spin up an indexer and graphql instance and test the subscription queries ``` cargo r --features indexer -- start --force-regenesis --with-indexer --with-graphql ``` - used the integrated graphiQL ui to issue subscription queries - used a third party graphql client (Postman) to issue the same queries > [!NOTE] > At approximately 1k subscribers, the local machine reached its operational limit. The sheer intensity and concurrent demand of managing the network, indexer, GraphQL server, and a high volume of WebSocket connections prevented reliable testing. In future iteration we could add **Prometheus** metrics to track the total amount of active subscribers, how many subscribers experience lags, ect... ### Infrastructure QA (only required for crates that are maintained by @iotaledger/infrastructure) - [ ] Synchronization of the indexer from genesis for a network including migration objects. - [ ] Restart of indexer synchronization locally without resetting the database. - [ ] Restart of indexer synchronization on a production-like database. - [ ] Deployment of services using Docker. - [ ] Verification of API backward compatibility. > [!NOTE] > The following patch does not affect the normal operation of the indexer, thus tests were skipped. ### Release Notes - [x] GraphQL: Add `Subscription` support for `Event` and `TransactionBlock`.
Description of change
This PR adds the feature to add subscription support for
eventsandtransactionsfor GraphQL.For filtering capabilities it leverages the
@oneOfdirective which does not allow more than one filter at a time for the input filter object.Links to any relevant issues
fixes #8561
How the change has been tested
Basic tests (linting, compilation, formatting, unit/integration tests)
Patch-specific tests (correctness, functionality coverage)
ran graphql tests
Note
At approximately 1k subscribers, the local machine reached its operational limit. The sheer intensity and concurrent demand of managing the network, indexer, GraphQL server, and a high volume of WebSocket connections prevented reliable testing.
In future iteration we could add Prometheus metrics to track the total amount of active subscribers, how many subscribers experience lags, ect...
Infrastructure QA (only required for crates that are maintained by @iotaledger/infrastructure)
Note
The following patch does not affect the normal operation of the indexer, thus tests were skipped.
Release Notes
Subscriptionsupport forEventandTransactionBlock.