Skip to content

Commit 2155537

Browse files
authored
chore: Force select-in strategy by passing pagination through (medusajs#11556)
* chore: Force select-in by passing pagination through * chore: Force select-in by passing pagination through
1 parent 0c95735 commit 2155537

File tree

1 file changed

+10
-2
lines changed
  • packages/core/modules-sdk/src/remote-query

1 file changed

+10
-2
lines changed

packages/core/modules-sdk/src/remote-query/query.ts

+10-2
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,21 @@ export class Query {
224224
pagination,
225225
})) as unknown as GraphResultSet<TEntry>
226226

227-
delete queryOptions.pagination
228227
delete queryOptions.filters
229228

229+
const graphOptions: RemoteQueryInput<TEntry> = {
230+
...queryOptions,
231+
pagination: {
232+
// We pass through `take` to force the `select-in` query strategy
233+
// There might be a better way to do this, but for now this should do
234+
take: queryOptions.pagination?.take,
235+
},
236+
}
237+
230238
let finalResultset: GraphResultSet<TEntry> = indexResponse
231239

232240
if (indexResponse.data.length) {
233-
finalResultset = await this.graph(queryOptions, {
241+
finalResultset = await this.graph(graphOptions, {
234242
...options,
235243
initialData: indexResponse.data,
236244
})

0 commit comments

Comments
 (0)