Graphql-flutter: Ability to set default Fetch-policy for all query requests

Created on 12 Jun 2019  路  3Comments  路  Source: zino-app/graphql-flutter

I see default fetch policy for Query is FetchPolicy.cacheFirst.

How we can set default fetch-policy for Query requests? I don't want to to change at each Query requests.

dart client enhancement

Most helpful comment

defaultPolicies handled this in #398

All 3 comments

This feature doesn't exist but is feasible

@micimize
How about receiving QueryOptions from below

https://github.com/zino-app/graphql-flutter/blob/519381cd1c57515fd26cedb33c68a68d563a6eac/packages/graphql/lib/src/graphql_client.dart#L17-L25

and expose it as a getter. Then when setting WatchQueryOptions below, get the default values provided from client and apply to _options getter if policy had not been provided in the widget?

https://github.com/zino-app/graphql-flutter/blob/519381cd1c57515fd26cedb33c68a68d563a6eac/packages/graphql_flutter/lib/src/widgets/query.dart#L38-L63

defaultPolicies handled this in #398

Was this page helpful?
0 / 5 - 0 ratings

Related issues

thanhbinh84 picture thanhbinh84  路  4Comments

campanagerald picture campanagerald  路  3Comments

endigo picture endigo  路  4Comments

jomag picture jomag  路  3Comments

vanelizarov picture vanelizarov  路  3Comments