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

fetchMore executing request multiple times #88

Closed
Laegel opened this issue Feb 2, 2021 · 4 comments
Closed

fetchMore executing request multiple times #88

Laegel opened this issue Feb 2, 2021 · 4 comments

Comments

@Laegel
Copy link

Laegel commented Feb 2, 2021

Hey there, first I'd like to thank everybody working on this wonderful library! Combined to GraphQL PPX, it's delightful.

I ran into the following issue: fetchMore executes a request multiple times (twice on my project even on simple requests not implying variables or specific stuff and four times on your own example: https://github.com/reasonml-community/rescript-apollo-client/blob/master/EXAMPLES/src/hooksUsage/Query_Typical.res#L35).
Have you ever seen that?

Thanks for reading!

@jeddeloh
Copy link
Owner

jeddeloh commented Feb 2, 2021

I feel like someone might have posted this issue a long time ago on discord at a time when I didn't have time to look into it. I assumed they worked it out, but I guess not. We should look into what's going on.

@jeddeloh
Copy link
Owner

jeddeloh commented Feb 2, 2021

I only took a quick look, but my intuition is that the issue stems from using a NetworkOnly fetch policy. This will trigger two fetches even in the case of no render after the call (no data changed). Seems like an Apollo issue to me. Maybe someone could confirm the behavior exists in a vanilla Apollo situation?

I think the client in examples is configured with NetworkOnly across the board. Maybe I'll just set that up with defaults for now.

@Laegel
Copy link
Author

Laegel commented Feb 2, 2021

Thanks for your quick answer. I do have the fetch policy as NetworkOnly too... I'll try something else to verify your theory!

@jeddeloh
Copy link
Owner

Gonna close this for now. Please reopen if you can confirm this isn't the JS behavior. Thanks!

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