Context
After #532 (PR #554), a faceted page costs 2 engine round-trips: the listing search, then — only once it resolves — the batched facet multi_search. The facet queries derive solely from the resolved SearchQuery, not from the listing result, so the second round-trip need not wait for (or even be separate from) the first.
Proposal
Two composable steps, in order of effort:
- Overlap: let the root resolver return its source synchronously with the listing search as a pending promise (
items/total sub-resolvers await it), so the facet dispatch fires in the same tick and the two round-trips run concurrently — max() instead of sum.
- Merge: facets whose effective
where (after skip-own-filter) equals the listing query’s where can ride the listing search via facet_by — the common unfiltered browse becomes 1 round-trip. Needs the root resolver to read the facet selection from GraphQLResolveInfo (including fragments), which ADR 4 anticipates (‘selection is the request’).
Acceptance
- Unfiltered browse: 1 Typesense round-trip (listing + facets in one search); filtered pages: concurrent, not sequential, round-trips.
- Facet counts, skip-own-filter semantics, per-facet failure isolation, and the GraphQL contract unchanged.
Notes
Context
After #532 (PR #554), a faceted page costs 2 engine round-trips: the listing search, then — only once it resolves — the batched facet
multi_search. The facet queries derive solely from the resolvedSearchQuery, not from the listing result, so the second round-trip need not wait for (or even be separate from) the first.Proposal
Two composable steps, in order of effort:
items/totalsub-resolvers await it), so the facet dispatch fires in the same tick and the two round-trips run concurrently —max()instead of sum.where(after skip-own-filter) equals the listing query’swherecan ride the listing search viafacet_by— the common unfiltered browse becomes 1 round-trip. Needs the root resolver to read the facet selection fromGraphQLResolveInfo(including fragments), which ADR 4 anticipates (‘selection is the request’).Acceptance
Notes