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

pollInterval None should cancel polling? #102

Closed
AlexMoutonNoble opened this issue Mar 9, 2021 · 3 comments
Closed

pollInterval None should cancel polling? #102

AlexMoutonNoble opened this issue Mar 9, 2021 · 3 comments

Comments

@AlexMoutonNoble
Copy link

AlexMoutonNoble commented Mar 9, 2021

Hi folks
I have been using react state to gate pollInterval on some queries, as some tasks progress on the back end. It took me a while to figure that None does not cancel a set interval. Should it? It seems like it should?

Seems likely a one liner. I can take a look if youre interested in a PR.

Thanks
Alex

@jeddeloh
Copy link
Owner

jeddeloh commented Mar 9, 2021

Poll interval is an option only because it is an optional argument. From the official docs, it looks like you should be passing 0 if you don't want it to poll: https://www.apollographql.com/docs/react/data/queries/#polling

@jeddeloh
Copy link
Owner

jeddeloh commented Mar 9, 2021

Also, it looks like there's a stopPolling method you can call on the queryResult?

@jeddeloh
Copy link
Owner

Gonna close this as I think the suggested solution will work.

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