zino-hofmann / graphql-flutter

A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.
https://zino-hofmann.github.io/graphql-flutter
MIT License
3.25k stars 622 forks source link

Should CacheProvider still be used? #1459

Open michael-markl opened 1 month ago

michael-markl commented 1 month ago

Describe the issue

It is not documented (unless I missed something) whether the CacheProvider widget should still be used.

In some examples (https://github.com/zino-hofmann/graphql-flutter/blob/main/packages/graphql_flutter/example/lib/graphql_widget/main.dart#L29) it is still used, and in some examples (https://github.com/zino-hofmann/graphql-flutter/blob/main/examples/starwars/lib/view/client/graphql_view.dart#L22) it is not used.

Also, its implementation consists of mostly commented out code, so I am not even sure, if CacheProvider in its current state does anything except checking that a GraphqlClient exists in the context (?).

If it is no longer of any use, I think the two options are: (a) Just remove the class entirely, potentially breaking users (b) Deprecate the class and add a comment that it should no longer be used.

If there is still a use case for CacheProvider, then it should be documented somewhere.

If I understand something wrong, I apologize in advance :)