jeddeloh / rescript-apollo-client

ReScript bindings for the Apollo Client ecosystem
MIT License
126 stars 18 forks source link

pollInterval None should cancel polling? #102

Closed AlexMoutonNoble closed 3 years ago

AlexMoutonNoble commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

jeddeloh commented 3 years ago

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