vulcainjs / vulcain-corejs

Microservice framework for nodejs
https://vulcainjs.github.io
Apache License 2.0
11 stars 3 forks source link

Pagination not working #32

Closed workfel closed 7 years ago

workfel commented 7 years ago

Hi,

I tried to use pagination, but it seem isn't working.

I created a DefaultQueryHandler and when i check the service description i have this verb.

{
"schema": "Contacts",
"kind": "query",
"verb": "contacts.all",
"outputType": "many",
"description": "Get all entities",
"action": "all",
"scope": "?",
"async": false,
"outputSchema": "Contacts"
}

When i launch .../api/contacts.all i getting all my record (8). And for use pagination i use this url .../api/contacts.all?maxByPage=3 but i getting no record.

It's my request who is malformed ?

Thx

malain commented 7 years ago

The correct syntax is .../api/contacts.all?$maxByPage=3 (maxByPage and page must be prepend with $) otherwise maxByPage is considered as a query filter (select only contacts with property maxByPage equals to 3).