Lomkit / laravel-rest-api

Generate Api in seconds
https://laravel-rest-api.lomkit.com/
MIT License
298 stars 18 forks source link

How can I return all records without pagination? #47

Closed devcodemarcos closed 6 months ago

devcodemarcos commented 9 months ago

Description

I have read the documentation and I have not found information about how to return all the records without pagination, is there a way to do this I ask?

example:

{
    "data": [ // all available records
        {
             "id": 1,
             "name": "text..."
        },
       {
             "id": 2,
             "name": "text..."
        },
       ...
   ]
}
GautierDele commented 9 months ago

Hello @devcodemarcos,

For now this is not possible, since it could be dangerous for frontend users, I would recommand to specify your limit according to your previsions (100 ?). Too much data could lead to API crash or front end lagging.

If you believe this is a feature that should be implemented could you give me some context on what you are trying to achieve so I can consider adding this please ?

devcodemarcos commented 9 months ago

Hi @GautierDele

The scenario in which I would like to be able to return all the records is when a client app tries to do an autocomplete and when writing the coincidences, not all of them are returned, having to write a lot of text until the word is almost completed.

GautierDele commented 6 months ago

I'll close this, if it gets more interests, i'll reopen