Skip to content
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

Enhancement based on GraphQL CRUD capabilities #16

Open
4 of 5 tasks
machi1990 opened this issue Jul 29, 2020 · 7 comments
Open
4 of 5 tasks

Enhancement based on GraphQL CRUD capabilities #16

machi1990 opened this issue Jul 29, 2020 · 7 comments

Comments

@machi1990
Copy link
Collaborator

machi1990 commented Jul 29, 2020

/cc @ani-sha @rareddy

@machi1990 machi1990 changed the title Capabilities GraphQL CRUD Capabilities Jul 29, 2020
@machi1990 machi1990 changed the title GraphQL CRUD Capabilities Enhancement based on GraphQL CRUD capabilities Jul 29, 2020
@machi1990
Copy link
Collaborator Author

I tested out the current master fa8438e, filtering seems to working (I'll perform extensive tests later on), but good job so far.

I have a question regarding the list query type e.g accounts from the shared image, are there plans to support pagination, i.e instead of returning the raw type but a container type that has raw type items and pagination info as indicated in https://graphqlcrud.org/docs/next/find#example-query

See:
app-testing

/cc @rareddy @wtrocki @ani-sha

@ani-sha
Copy link
Member

ani-sha commented Sep 14, 2020

Yes, we have thought of adding pagination after modifying and implementing the filters entirely. There are a few more tests and functions to add.

@rareddy
Copy link
Collaborator

rareddy commented Sep 14, 2020

In the pagination scenario, what mechanism do you offer the user to get the "next" page after the first page is returned?

@wtrocki
Copy link
Member

wtrocki commented Sep 14, 2020

In dynamic systems using calculated cursor would be more appropriate.
We use limit and offset, but that is susceptible to seeing duplicates etc.

@wtrocki
Copy link
Member

wtrocki commented Sep 14, 2020

On the client side pages will be kept in the component state and deduplicated so we could provide support for two types of pagination:

  • Unlimited scrolling (uses the client-side state to fetch the next page without calculating count)
  • Client requests count and uses limit offset for classical pagination

While this has obvious challenges this is something we have implemented and we have flexibility to change offset to be used as generic string token to provide backward compatibility if we hit issues.

@rareddy
Copy link
Collaborator

rareddy commented Sep 14, 2020

ok, yes with offset you can see the potential for incorrect results when database state changed, but that is easiest otherwise we would need to build a local cache for it :(

How is paging done at the nested level? or this only at the top level?

@wtrocki
Copy link
Member

wtrocki commented Sep 14, 2020

Pagination and filtering can be done on the nested level as well by defining arguments to field directly for the type:

Example:
Screenshot 2020-09-14 at 17 17 11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants