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

Pagination Helper: it only works when format option is set to tagged #258

Open
Lepozepo opened this issue Apr 9, 2024 · 2 comments
Open

Comments

@Lepozepo
Copy link

Lepozepo commented Apr 9, 2024

I have a case where formatting is set to simple and was surprised to see data not iterating as documented when using client.paginate(fql...). Maybe just an update to the documentation on the formatting requirement would go a long way

@ptpaterson
Copy link
Contributor

Hi @Lepozepo. The driver needs the tagged format so that the response is known to be encoded as a Set. This might be a good argument for accepting a PageLike interface, i.e. working with any response that is an object which contains a data field that is an array with an optional after field which is a string. We could also throw an error if you try to use Client.paginate when the client is configured with a different format.

Can I ask, for what purpose are you changing the format. The default tagged format is meant to be the default in most cases. We'd love to hear more about how you are using the driver.

@Lepozepo
Copy link
Author

@ptpaterson it's definitely an edge case, I have a desktop client app built for Fauna that I use heavily. For that particular scenario I found it easier to have non-tagged responses for rendering. It just threw me off, definitely agree that the tagged format should be the go to.

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

2 participants