-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Optimizer window pagination #613
Comments
Hey @Kitefiko , Hrm, I'm not really I understood the issue. When and why does |
Hi @bellini666 We've run into these issue as well, particularly with strawberry-django/strawberry_django/relay.py Line 195 in d6051db
Just so its clear, the has_next_page = (
result[-1]._strawberry_row_number < result[-1]._strawberry_total_count
if result
else False
) |
@bellini666 FYI #622 only fixes 1 of the 4 problems raised in this issue, so it may be worth keeping this open? |
@SupImDos good point, going to reopen this |
Describe the Bug
I believe I have found multiple issues with window pagination implementation.
AttributeError
is always thrown inListConnectionWithTotalCount.resolve_connection_from_cache
AttributeError
prevents paginationlast
returns everything and bypassesmax_results
System Information
Additional Context
ListConnectionWithTotalCount.resolve_connection_from_cache
AttributeError
is always thrown here:strawberry-django/strawberry_django/relay.py
Line 195 in d6051db
I think there should be something like this?
Backup solution in case of
AttributeError
prevents paginationThis might be intended behavior, but:
In case of
AttributeError
pagination falls back toresolve_connection
but (probably due to unavailable overfetch?)pageInfo
'shasNextPage
is wrongly reporting asfalse
Order and thus pagination itself is non-deterministic when explicit order is not used
This is probably the biggest issue. Maybe fixable via
pk
ordering in case of emptyorder_by
inapply_window_pagination
?Usage of
last
returns everything and bypassesmax_results
When
last
is used on it's own and execution ends up here:strawberry-django/strawberry_django/optimizer.py
Lines 561 to 573 in d6051db
slice_metadata.start
is evaluated to 0slice_metadata.end
becomessys.maxsize
and queryset ends up filtering out nothing
Upvote & Fund
The text was updated successfully, but these errors were encountered: