Commit ec99569
feat(iota-graphql-rpc): Subscriptions support (#9365)
# Description of change
This PR adds the GraphQL subscription support for `Events` and
`Trnsactions`. Internally it leverages the `InMemory` broker from the
new introduced `iota-indexer-streaming` crate in the monorepo.
Currently this feature is only available for `devnet` & local networks,
as the feature is still in alpha.
## Links to any relevant issues
fixes #8784
## How the change has been tested
- 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
- [x] Basic tests (linting, compilation, formatting, unit/integration
tests)
- [ ] Patch-specific tests (correctness, functionality coverage)
### 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] Indexer: introduce to monorepo the `iota-indexer-streaming` crate
which holds logic related to `iota-indexer` streaming capabilities for
streaming `events` and `transactions`.
- [x] GraphQL: Add `Subscription` support for `Event` and
`TransactionBlock`. Currently this feature is only available for
`devnet` & local networks, as the feature is still in alpha.
---------
Co-authored-by: Marc Espin <mespinsanz@gmail.com>1 parent 00f4a39 commit ec99569
File tree
27 files changed
+1840
-57
lines changed- .changeset
- .github
- crates
- iota-graphql-rpc
- src
- extensions
- server
- types
- event
- subscription
- tests/snapshots
- iota-indexer-streaming
- src
- iota-indexer
- migrations/pg/2025-09-10-071522_events_and_transactions_triggers
- src
- models
- sdk
- graphql-transport/src/generated
- typescript/src/graphql/generated/2025.2
27 files changed
+1840
-57
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
419 | 420 | | |
420 | 421 | | |
421 | 422 | | |
| 423 | + | |
422 | 424 | | |
423 | 425 | | |
424 | 426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
0 commit comments