Skip to content

feat(indexer): add MockGraphQLIndexer and createMockIndexer (#607) - #676

Open
ZacLou wants to merge 2 commits into
conduit-protocol:mainfrom
ZacLou:feat/mock-indexer-607
Open

feat(indexer): add MockGraphQLIndexer and createMockIndexer (#607)#676
ZacLou wants to merge 2 commits into
conduit-protocol:mainfrom
ZacLou:feat/mock-indexer-607

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Provides an in-memory drop-in replacement for GraphQLIndexer so consumers can unit-test indexer-backed code without stubbing global fetch.

Changes

  • New MockGraphQLIndexer class:
    • query() returns preset responses from a query map
    • subscribe() emits preset events on next tick
    • strict mode throws on unknown queries; non-strict returns undefined
  • New createMockIndexer(options) convenience factory
  • Exported from src/index.ts alongside the real GraphQLIndexer
  • Tests: src/tests/mock-indexer.test.ts covers queries, subscriptions, strict mode, unsubscribe, and destruction

Closes #607

…uit-protocol#606)

- Export resolveFee from src/index.ts so consumers can compute effective fees
- Add fee and feeMultiplier rows to ConduitClient configuration table
- Add Fee Precedence section to README explaining the resolution order:
  explicit fee > feeMultiplier * BASE_FEE > BASE_FEE

Closes conduit-protocol#606
…protocol#607)

- MockGraphQLIndexer serves preset query responses and subscription events
- createMockIndexer factory for quick test setup
- Exported from src/index.ts alongside GraphQLIndexer
- Supports strict mode (throws on unknown queries) and non-strict mode (returns undefined)
- Subscription events emitted on next tick with configurable timing
- Add unit tests for queries, subscriptions, strict mode, unsubscribe, and destruction

Closes conduit-protocol#607
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.

Provide a mock transport for GraphQLIndexer

1 participant