-
Notifications
You must be signed in to change notification settings - Fork 317
Default ScrollSubrange is not applied correctly for backwards scrolling in QueryDSL and QBE #900
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
Comments
Thanks for the report. |
@mspiess thanks for the report again. There is now a fix available in |
Hi, @rstoyanchev, Line 91 in b727854
Shouldn't that line assert |
For example, given following Entity:
Associated query: query {
todos(last: 1) {
...
}
} Actual response: {
"data": {
"todos": {
"edges": [
{
"node": {
"id": 1,
"content": "Todo 1"
}
}
]
}
}
} Expected response: {
"data": {
"todos": {
"edges": [
{
"node": {
"id": 2,
"content": "Todo 2"
}
}
]
}
}
} |
Offset Scrolling works by getting results beginning at an offset, and so there is no concept of going back. Instead we we advance the index back and turn backward to forward. For example, given request for the last 5 relative to 50, we create On further thought, I don't see a straight forward way to support Thinking about what could be done, perhaps we could reverse the |
Requesting the last In other words, reversing the sort order (if a sort order is provided), fetching the first |
What about Keyset Scrolling? The issue also applies when a default scroll subrange with a keyset |
Example:
There is a Entity called
Document
.Schema:
A query for
document
returns the same data, regardless of whetherfirst
orlast
is provided.The culprit:
QuerydslDataFetcher#ScrollableEntityFetcher.getResult
uses thelimit
from the subrange that is build out of the arguments. If a cursor is provided usingbefore
orafter
it also uses the built subrange's position, which has the intended direction. However in the case where there is no cursor provided, it uses the default subrange's position, overriding the provided direction.The text was updated successfully, but these errors were encountered: