chore: Force select-in strategy by passing pagination through (#11556)

* chore: Force select-in by passing pagination through

* chore: Force select-in by passing pagination through
This commit is contained in:
Oli Juhl authored and GitHub committed 2025-02-23 14:42:19 +01:00
1 parent 0c957350a6
commit 215553792b
1 file changed
+10 -2
@@ -224,13 +224,21 @@ export class Query {
pagination, pagination,
})) as unknown as GraphResultSet<TEntry> })) as unknown as GraphResultSet<TEntry>
delete queryOptions.pagination
delete queryOptions.filters delete queryOptions.filters
const graphOptions: RemoteQueryInput<TEntry> = {
...queryOptions,
pagination: {
// We pass through `take` to force the `select-in` query strategy
// There might be a better way to do this, but for now this should do
take: queryOptions.pagination?.take,
},
}
let finalResultset: GraphResultSet<TEntry> = indexResponse let finalResultset: GraphResultSet<TEntry> = indexResponse
if (indexResponse.data.length) { if (indexResponse.data.length) {
finalResultset = await this.graph(queryOptions, { finalResultset = await this.graph(graphOptions, {
...options, ...options,
initialData: indexResponse.data, initialData: indexResponse.data,
}) })