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

Support CursorPaging.first being null or add a extra parameter to fetch all. #63

Closed
ValentinVignal opened this issue Nov 23, 2022 · 0 comments · Fixed by #87
Closed
Labels
enhancement New feature or request

Comments

@ValentinVignal
Copy link
Contributor

This is kind of a follow-up of #62

Is your feature request related to a problem? Please describe.

As explained in #62 I want to use a paginated query most of the time. But in some specific/rare scenarios, I would like to fetch the entire list of items (and not only the first page).

Using 2 resolvers as suggested in #62 (comment) brings some issues because the type of the query changes between the paginated one (TodoConnection) and the unpaginated one (Todo).
For some languages/front-end stack (I'm using Flutter (dart) and ferry), the type differences are an issue and prevent abstractions.

That's why I would need to be able to reuse the same request/query for unpaginated and paginated lists.

Have you read the Contributing Guidelines?

Yes.

Describe the solution you'd like

Supporting and not specifying any CursorPaging.first or CusorPaging.last could return the entire list instead of just a page.
The returned type would still be TodoConnection, it's just that the edges will contain all the nodes.

Describe alternatives you've considered

Give an arbitrary very high value to first (ex: 1000)

@ValentinVignal ValentinVignal added the enhancement New feature or request label Nov 23, 2022
@TriPSs TriPSs closed this as completed in #87 Apr 8, 2024
TriPSs added a commit that referenced this issue Apr 8, 2024
… to return all the items with `-1` (#87)

Fixes #63

Querying the todo items from the
[example](https://tripss.github.io/nestjs-query/docs/introduction/example)

```graphql
  todoItems(paging: {first:-1}) {
    # ...
  }
```

returns the entire list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant