I need some help in understanding how to use the poll_interval with the standalone graphql package. Not with graphql_flutter which provides Query and Mutation widgets.
I tried the flutter flutter_bloc example which apparently uses the poll_interval parameter in WatchQueryOptions but it does not execute the query again after the interval maybe because it's in a function.
For pollInterval to work, instead of using _client.query, I think you have to use _client.watchQuery instead. That will add the query to the schedule for polling at a set interval.
I need some help in understanding how to use the poll_interval with the standalone graphql package. Not with graphql_flutter which provides Query and Mutation widgets.
I tried the flutter flutter_bloc example which apparently uses the poll_interval parameter in WatchQueryOptions but it does not execute the query again after the interval maybe because it's in a function.
Future<QueryResult> getRepositories(int numOfRepositories) async
{ final WatchQueryOptions _options = WatchQueryOptions(
document: readRepositories, variables: <String, dynamic>{ 'nRepositories': numOfRepositories, },
pollInterval: 4, fetchResults: true, );
return await client.query(_options); }
How can I use the polling feature from the graphql package in a function as given in the example? Any help would be great.