-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination #31
Comments
Currently I have no plans, but PRs are welcome :) |
How would you like to have the pagination? As fetch params?
|
something like that would be cool. i think it would need to return: I'll see what i can come up with! |
Thanks for your answer :)
Could you specify what this means?
I'm thinking about how we could give that meta information to the developer. Currently the fetch action returns a object with the fetched data. We could change that so that fetch returns an object with meta information. I could think about:
const meta = await User.fetch(null, { perPage: 8, page: 2}); // null means no filterting
console.log(meta); {
records: 7,
perPage: 8,
currentPage: 2,
lastPage: 2,
queryTime: 86, // ms
records: {
users: [ ... ],
profiles: [ ... ]
}
} We could add more information in the future. For consistency I think the other actions should also return this meta object despite there will be no page information. |
I'm going to have a need for this shortly. What would be involved in implementing this - just modifying the queryBuilder? |
Probably. I didn't looked at pagination in depth, so I can't tell currently. Also I'm really busy currently and can't implement this. First step would be to introduce pagination in the test schema and setup some specs so implement against. Then I think the |
I'll have a look and see if we can fit this into our schedule. I also need to be able to return arbitrary data attached to edges - so not sure if this would be a natural extension. Or something we just implement internally. |
Fetching of arbitrary data could be possible via model unrelated custom queries: https://vuex-orm.github.io/vuex-orm-graphql/guide/custom-queries/#model-unrelated-simple-query |
If someone does impliment this, please make generic to also support:
|
will this be supported soon?
The text was updated successfully, but these errors were encountered: