Skip to content

Commit 0a56ba9

Browse files
Merge pull request #197 from objectstack-ai/copilot/fix-action-job-issue
2 parents 1759209 + 2a5c3d9 commit 0a56ba9

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

packages/runtime/server/test/graphql.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ class MockDriver implements Driver {
4343
async find(objectName: string, query: any) {
4444
let items = this.data[objectName] || [];
4545

46-
// Apply skip and limit if provided
46+
// Apply offset and limit if provided (QueryAST uses 'offset', not 'skip')
4747
if (query) {
48-
if (query.skip) {
49-
items = items.slice(query.skip);
48+
if (query.offset) {
49+
items = items.slice(query.offset);
5050
}
5151
if (query.limit) {
5252
items = items.slice(0, query.limit);

packages/runtime/server/test/rest-advanced.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ class MockDriver implements Driver {
4141
}
4242
}
4343

44-
// Apply skip and top/limit (QueryAST uses 'top' for limit)
45-
if (query?.skip) {
46-
items = items.slice(query.skip);
44+
// Apply offset and limit (QueryAST uses 'offset' for skip)
45+
if (query?.offset) {
46+
items = items.slice(query.offset);
4747
}
4848
if (query?.top || query?.limit) {
4949
items = items.slice(0, query.top || query.limit);
@@ -87,9 +87,9 @@ class MockDriver implements Driver {
8787
}
8888

8989
async count(objectName: string, query: any) {
90-
// Count should not apply skip/limit, only filters
90+
// Count should not apply offset/limit, only filters
9191
const countQuery = { ...query };
92-
delete countQuery.skip;
92+
delete countQuery.offset;
9393
delete countQuery.top;
9494
delete countQuery.limit;
9595
const items = await this.find(objectName, countQuery);

0 commit comments

Comments
 (0)