Skip to content

fix(indexer): implement real GraphQL network I/O for query and subscribe - #248

Merged
Jaydbrown merged 2 commits into
conduit-protocol:mainfrom
morelucks:fix/graphql-indexer-network-io
Jul 29, 2026
Merged

Jaydbrown merged 2 commits into
conduit-protocol:mainfrom
morelucks:fix/graphql-indexer-network-io

Conversation

@morelucks

Copy link
Copy Markdown
Contributor

Summary of Changes

  • Real GraphQL Query Execution: Replaced mock stub in GraphQLIndexer.query() with a real HTTP POST request sending { query, variables } to this.endpoint and parsing JSON responses.
  • Real GraphQL Subscriptions: Replaced synthetic setInterval in GraphQLIndexer.subscribe() with real WebSocket transport (graphql-transport-ws protocol handling connection_init, subscribe, next/data, error messages) and a text/event-stream SSE reader fallback.
  • Lifecycle & Teardown: Preserved active subscription tracking, unsubscribe() socket/fetch abort cleanup, cleanup(), and isDestroyed boundary protection.
  • Tests: Added tests verifying real HTTP POST request structure, error responses, and subscription cleanup.

Fixes #177

@morelucks

Copy link
Copy Markdown
Contributor Author

@Jaydbrown kindly review

morelucks and others added 2 commits July 29, 2026 23:58
Replace any-typed globalThis/fetch/WebSocket access with narrow inline
casts, type the fetch subscription's catch handler as unknown with a
proper instanceof narrow for AbortError detection, and null-coalesce
getWebSocketCtor's globalThis lookup to match its declared return type.
@Jaydbrown
Jaydbrown force-pushed the fix/graphql-indexer-network-io branch from 3fff5a8 to 0a0a6b4 Compare July 29, 2026 23:07
@Jaydbrown
Jaydbrown merged commit e05c5d1 into conduit-protocol:main Jul 29, 2026
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

Successfully merging this pull request may close these issues.

Bug: GraphQLIndexer never performs a real query or subscription

2 participants