I just upgrade graphql_flutter version "3.1.0" to "5.0.0-nullsafety.5".
IDE has an exception: "The method 'OptimisticCache' isn't defined for the type 'GraphQLService'."
My code:
ValueNotifier(
GraphQLClient(
cache: OptimisticCache(dataIdFromObject: typenameDataIdFromObject),
link: link,
defaultPolicies: DefaultPolicies(
watchQuery: Policies(
fetch: FetchPolicy.noCache,
),
query: Policies(
fetch: FetchPolicy.noCache,
),
mutate: Policies(
fetch: FetchPolicy.noCache,
),
),
),
)
How to fix it?
GraphQLCache()? It seems that you can specify through theGraphQLCache()instance that you want to use an OptimisticCache. See the documentation of graphql_flutter for GraphQLCache: pub.dev/documentation/graphql/latest/graphql/…