Skip to content

feat(indexer): Automatic Persisted Queries support (#629) - #655

Merged
Jaydbrown merged 6 commits into
conduit-protocol:mainfrom
ZacLou:feat-persisted-query-629
Aug 31, 2026
Merged

feat(indexer): Automatic Persisted Queries support (#629)#655
Jaydbrown merged 6 commits into
conduit-protocol:mainfrom
ZacLou:feat-persisted-query-629

Conversation

@ZacLou

@ZacLou ZacLou commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Closes #629

Adds Automatic Persisted Queries (APQ) support to GraphQLIndexer.query:

  • When persist is enabled (default), the first request sends a SHA-256 hash of the query instead of the full query string.
  • If the server responds with PERSISTED_QUERY_NOT_FOUND, the client retries with the full query plus the hash so the server can cache it.
  • persist: false disables APQ and sends the full query string directly.
  • Includes unit tests for the hash request, the fallback path, and the opt-out.

Depends on #653 (feat(errors): typed error hierarchy) because this branch builds on the updated src/indexer.ts to avoid merge conflicts.

@Jaydbrown
Jaydbrown merged commit 306415d into conduit-protocol:main Aug 31, 2026
Jaydbrown added a commit that referenced this pull request Aug 31, 2026
- soroban.ts / tsconfig.build.json: a merge wrote literal "\n" instead of
  newlines (an import statement and the file's trailing brace), breaking
  the TS parse. Restored real line breaks.
- indexer.ts: widen executeGraphQLRequest's payload type so the APQ
  `extensions` (optional, may be undefined) type-checks under
  exactOptionalPropertyTypes.
- graphql-indexer tests: #624's typed-error hierarchy replaced the DOM
  `AbortError` with `OperationAbortedError` for caller-initiated aborts —
  updated the #569 timeout/abort suite to expect it. #629's APQ adds an
  async WebCrypto hash before the request and sends `query: null` + hash on
  the first attempt; updated the timeout tests to wait for the fetch before
  advancing timers and the real-POST test to assert the APQ body shape.
- streams.test.ts: the #622 getStreamInfos suite referenced StreamsModule
  without importing it in that block; added the dynamic import like the
  sibling describe.
- indexer.test.ts: non-null assertions on fetch mock call tuples
  (noUncheckedIndexedAccess).

npm run typecheck / lint / build and the full vitest suite (999 passing)
green locally.
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.

GraphQLIndexer: persisted-query support

2 participants