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 causes query to be fired 10+ times every iteration #710

Closed
MattGson opened this issue Aug 10, 2020 · 1 comment
Closed

pollInterval causes query to be fired 10+ times every iteration #710

MattGson opened this issue Aug 10, 2020 · 1 comment

Comments

@MattGson
Copy link

Describe the bug
When using the pollInterval query option, the query is refetched on a fixed interval i.e. every 10 seconds.
Instead of making a single network request each iteration, many requests are fired simultaneously. Sometimes more than 10 at once for a single query.

To Reproduce

Create a query with a pollInterval i.e. 10 seconds

@override
Widget build(BuildContext context) {
     Query(
         options: QueryOptions(
         documentNode: MyQuery.document,
         pollInterval: 10,
          variables: {
            'id': 5,
          },
        ),
        builder: (QueryResult result, {fetchMore, refetch}) {
             return SizedBox();
        } 
    );
}

Expected behavior
The query will be refetched from the network every 10 seconds.

Screenshots
Below is my server logs showing the query being fired many times on a single poll (notice timestamp is exactly the same).
Screen Shot 2020-08-10 at 6 44 28 PM

@MattGson
Copy link
Author

Seems to be resolved in 3.1.0. Possibly related to (#533)

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

1 participant