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

changed tests to expected behavior of object pageInfo.has*Page #824

Merged
merged 4 commits into from
Nov 7, 2022

Conversation

s3tezsky
Copy link
Contributor

@s3tezsky s3tezsky commented Mar 11, 2021

Q A
Bug fix? maybe it will be?
New feature? no
BC breaks? probably yes
Deprecations? no
Tests pass? no - intentionally
Documented? no
Fixed tickets #...
License MIT

Hello, I am really confused about object pageInfo when using pagination.

IMO the current implementation is wrong because e.g. hasPreviousPage is always returning false (when using fisrt and after combination) even there are some items which could be listed and provided data set to pagination contains the one more previous result for it.

I have walked through GraphQL specification and your documentation but unfortunatelly found no well described information about this.

The best informations are here which lead me to creating this PR.
Besides there was a PR (#31) probably with the same trouble but it was closed with no more informations about it.

I wanted to create an issue but breaking your tests to demonstrate my expectations seems much better to me.

Could you please explain to me what am I missing if it is wrong? Otherwise I would appreciate admitting it is wrong on your side and I could probably help with fixing it.

Cheers!

@s3tezsky
Copy link
Contributor Author

Hello, is there any chance you will have time to validate this issue? Any information about it would be great! 🙏

@mcg-web
Copy link
Member

mcg-web commented Jun 23, 2021

Hello @s3tezsky, the implementation of the bundle first follow the Relay Specs. We are not against changes but to stay compatible with Relay client, we need to reference the specs section leading to changes in this PR.

@s3tezsky
Copy link
Contributor Author

s3tezsky commented Jun 25, 2021

Thanks @mcg-web for the reply. Actually my proposal shoul be OK with relay specs - in further reading I am getting to this paragraph (https://relay.dev/assets/files/connections-61fc54c286f0afc0b4f230f7c4b150bf.htm#sec-undefined.PageInfo.Fields) which may bahave the same as my expectation. That is the main reason why I am a bit confused it is not implemented that way.
EDIT: AFAIK the linked article has no permanent URL. To be clear I am pointing to this https://github.com/facebook/relay/blob/master/website/spec/Connections.md#fields-2

@s3tezsky s3tezsky force-pushed the weird-behavior-of-has-page-fields branch from 9f1bc12 to 095e7dc Compare August 29, 2021 06:54
@s3tezsky
Copy link
Contributor Author

s3tezsky commented Aug 30, 2021

Hi @mcg-web!

I have pushed a commit which fixes the behavior of PageInfo object. I have only 2 unresolved issues:

  1. The build is failing on non-existent service (after rebasing on master it is still failing) - I can give it a look later.
  2. I had changed the case when there are wrong provided fields before and after (logicaly imposible intersection) - which I belive should be handled as InvalidArgumentException.

According to provided relay specification do you think this proposal could be accepted? Or is there anything suboptimal from your point of view?

As this change should be considered as BC break I am looking forward to see the first major version 🙏 !

Cheers!

@SparkDragon
Copy link

Any news about this ? I'm having this issue too.
I've tested the fix created by s3tezsky which is working great.

Would be great if it could be merged soon :)

@SparkDragon
Copy link

Up

1 similar comment
@jordancros
Copy link

Up

@mcg-web mcg-web merged commit 931f121 into overblog:master Nov 7, 2022
@s3tezsky s3tezsky deleted the weird-behavior-of-has-page-fields branch June 23, 2023 08:29
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

Successfully merging this pull request may close these issues.

None yet

4 participants