File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
packages/runtime/server/test Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments