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

The caching is not controlled by ErrorPolicy #405

Closed
nekocode opened this issue Sep 4, 2019 · 2 comments
Closed

The caching is not controlled by ErrorPolicy #405

nekocode opened this issue Sep 4, 2019 · 2 comments
Labels
🐛 bug Something isn't working 📦 cache Relates to caching functionality

Comments

@nekocode
Copy link

nekocode commented Sep 4, 2019

Why the caching is not controlled by ErrorPolicy ?

See here:
https://github.com/zino-app/graphql-flutter/blob/master/packages/graphql/lib/src/core/query_manager.dart#L115-L121

Is this to be expected?

@micimize
Copy link
Collaborator

micimize commented Sep 6, 2019

I guess according to the apollo docs it is not expected. In fact, this is probably a fairly critical issue

By default, the error policy treats any GraphQL Errors as network errors and ends the request chain. It doesn't save any data in the cache, and renders your UI with the error prop to be an ApolloError

@micimize micimize added the 🐛 bug Something isn't working label Sep 6, 2019
@klavs klavs added the 📦 cache Relates to caching functionality label Feb 18, 2020
@micimize micimize added 👵 outdated Outdated and will be closed soon unless reproduced on the latest beta and removed 👵 outdated Outdated and will be closed soon unless reproduced on the latest beta labels Oct 26, 2020
micimize added a commit to micimize/graphql-flutter that referenced this issue Oct 26, 2020
micimize added a commit to micimize/graphql-flutter that referenced this issue Nov 6, 2020
@micimize
Copy link
Collaborator

micimize commented Nov 6, 2020

Fixed by #754

@micimize micimize closed this as completed Nov 6, 2020
HofmannZ pushed a commit that referenced this issue Nov 7, 2020
# [4.0.0-beta.4](v4.0.0-beta.3...v4.0.0-beta.4) (2020-11-07)

### Bug Fixes

* **client:** add CacheMissException for when write/read results in null ([a0a967f](a0a967f))
* **client:** fetchMore partial handling ([10ec576](10ec576))
* **client:** skip cache writes on null data, thus fixing [#405](#405) ([7472bb9](7472bb9))

### Features

* **client:** cache writes are now strict, and throw PartialDataException (from normalize), ([616b5ed](616b5ed))
* **client:** carry forward data on exception ([ccf3b9c](ccf3b9c))
* **client:** only rebroadcast on deep equals ([ee64e99](ee64e99))
* **client:** partialDataPolicy for configuring rejections ([0a7cd28](0a7cd28))
HofmannZ pushed a commit that referenced this issue Jan 31, 2021
# [4.0.0](v3.1.0...v4.0.0) (2021-01-31)

### Bug Fixes

* **examples:** starwars example cache ([22db4f7](22db4f7))
* fix ObservableQuery.lifecycle for cache only results ([f44b479](f44b479))
* **client:** mutation not firing observer callbacks ([75393c2](75393c2))
* query test ([f54c6ae](f54c6ae))
* **ci:** loosen path version ([645d462](645d462))
* **client:** add CacheMissException for when write/read results in null ([a0a967f](a0a967f))
* **client:** fetchMore partial handling ([10ec576](10ec576))
* **client:** gql_http_link==0.3.2 for custom toJsons closing [#734](#734) ([98b8cf7](98b8cf7))
* **client:** only queries are refetch safe ([1e93376](1e93376))
* **client:** refetch overrides fetchPolicy ([891bc2b](891bc2b))
* **client:** skip cache writes on null data, thus fixing [#405](#405) ([7472bb9](7472bb9))
* **client:** wrap all subscription errors in QueryResults ([aae61ca](aae61ca))
* **docs:** typo in docstring, add todo to sanitizeVariables ([9c84cb1](9c84cb1))
* **examples:** cleanup bloc example ([82724f0](82724f0))
* **examples:** flutter bloc pubspec ([61582b3](61582b3))
* **examples:** ignore missing token ([ffd3294](ffd3294))
* **examples:** starwars example works again ([7514b93](7514b93))
* **examples:** update ios files for graphql_flutter/example ([5b6e3d0](5b6e3d0))
* **graphql:** default-yet-overrideable variable ([6ba687e](6ba687e))
* **graphql:** don't close mutations after callbacks ([2ba6c74](2ba6c74))
* **graphql:** dumb ?? documentNode bug ([ba7b641](ba7b641))
* **graphql:** fix rebroadcasting by refactoring onData callbacks into a simpler async function ([9a5fff1](9a5fff1))
* **graphql:** keep deprecated QueryResult api and mark it as such ([2b447a0](2b447a0))
* **graphql:** sanitize multipart files for cache ([4ceb800](4ceb800))
* **graphql:** simplified AuthLink ([0b3fbd9](0b3fbd9))
* **tests:** update tests ([bba4a7a](bba4a7a))

### Features

* cache now flags itself for broadcasting ([84cba43](84cba43))
* client.fetchMore utility for leveraging the fetch more logic results without using ObservableQuery ([814ccb3](814ccb3))
* documentNode -> document, dependency issues, reexport links from client (for now), retrieve subscription changes from [#533](#533) ([4fb205c](4fb205c))
* **graphql:** HiveStore.open ([6db4677](6db4677))
* drop Link layer in favor of package:gql_link and package:gql_exec ([2e491a7](2e491a7))
* **client:** add context to QueryResult ([fbc5a2d](fbc5a2d))
* **client:** cache proxy methods on cache, resetStore with optional refetchQueries ([ba7134a](ba7134a))
* **client:** cache writes are now strict, and throw PartialDataException (from normalize), ([616b5ed](616b5ed))
* **client:** CacheRereadPolicy, watchMutation workaround ([32e02da](32e02da))
* **client:** carry forward data on exception ([ccf3b9c](ccf3b9c))
* **client:** expose store, cleanup ([6fc5e7e](6fc5e7e))
* **client:** only rebroadcast on deep equals ([ee64e99](ee64e99))
* **client:** partialDataPolicy for configuring rejections ([0a7cd28](0a7cd28))
* **client:** QueryResult.unexecuted ([13e3257](13e3257))
* **client:** refetchSafeQueries, clarify rebroadcast calls in docs ([e45b240](e45b240))
* **docs:** v4 changelog ([38cfd9b](38cfd9b))
* **examples:** reorg graphql example so pub displays code ([bc32bdd](bc32bdd))
* **examples:** starwars hivestore usage ([2f874ec](2f874ec))
* **graphql:** add isMutation etc helpers to Options types ([04e7888](04e7888))
* **graphql:** complete caching overhaul ([e9b5660](e9b5660))
* **graphql:** HiveStore api improvements, fetchmore fixes ([2d1a7f2](2d1a7f2))
* **graphql:** multipart file support ([c2733ca](c2733ca))
* **graphql:** re-add documentNode asdeprecated ([20d0176](20d0176))
* more work on gql links ([0d7ef7a](0d7ef7a))
* **graphql:** Robust ObservableQuery docs ([1e893b5](1e893b5))
* **graphql:** update old websocket_link ([496d994](496d994))
* **graphql:** upgrade normalize to 0.4.2 ([4655e7d](4655e7d))
* **graphql:** use new cache correctly everywhere else ([f64a6c8](f64a6c8))
* starting on gql links ([d9452bc](d9452bc))
* **graphql:** work on making subscriptions more of a first-class citizen ([6d0b045](6d0b045))
* **graphql_flutter:** add ResultAccumulator, fix Subscription ([7e1edee](7e1edee))
* **graphql_flutter:** initHiveForFlutter ([1118cc7](1118cc7))
* HiveStore ([2c3c66c](2c3c66c))
* move to DocumentNode-only documents ([7499323](7499323))
* **graphql_flutter:** work on making subscriptions more of a first-class citizen ([a0e0d5c](a0e0d5c))
* **tests:** test subscriptions ([2a3e6a1](2a3e6a1))

### BREAKING CHANGES

* **client:** By fixing the defaults for mutations, the old behavior
is now lost
* the deprecated string documents are no longer supported
* Link layer is now implemented via package:gql_link and package:gql_exec
micimize pushed a commit that referenced this issue Jan 31, 2021
# [4.0.0](v3.1.0...v4.0.0) (2021-01-31)

### Bug Fixes

* **examples:** starwars example cache ([22db4f7](22db4f7))
* fix ObservableQuery.lifecycle for cache only results ([f44b479](f44b479))
* **client:** mutation not firing observer callbacks ([75393c2](75393c2))
* query test ([f54c6ae](f54c6ae))
* **ci:** loosen path version ([645d462](645d462))
* **client:** add CacheMissException for when write/read results in null ([a0a967f](a0a967f))
* **client:** fetchMore partial handling ([10ec576](10ec576))
* **client:** gql_http_link==0.3.2 for custom toJsons closing [#734](#734) ([98b8cf7](98b8cf7))
* **client:** only queries are refetch safe ([1e93376](1e93376))
* **client:** refetch overrides fetchPolicy ([891bc2b](891bc2b))
* **client:** skip cache writes on null data, thus fixing [#405](#405) ([7472bb9](7472bb9))
* **client:** wrap all subscription errors in QueryResults ([aae61ca](aae61ca))
* **docs:** typo in docstring, add todo to sanitizeVariables ([9c84cb1](9c84cb1))
* **examples:** cleanup bloc example ([82724f0](82724f0))
* **examples:** flutter bloc pubspec ([61582b3](61582b3))
* **examples:** ignore missing token ([ffd3294](ffd3294))
* **examples:** starwars example works again ([7514b93](7514b93))
* **examples:** update ios files for graphql_flutter/example ([5b6e3d0](5b6e3d0))
* **graphql:** default-yet-overrideable variable ([6ba687e](6ba687e))
* **graphql:** don't close mutations after callbacks ([2ba6c74](2ba6c74))
* **graphql:** dumb ?? documentNode bug ([ba7b641](ba7b641))
* **graphql:** fix rebroadcasting by refactoring onData callbacks into a simpler async function ([9a5fff1](9a5fff1))
* **graphql:** keep deprecated QueryResult api and mark it as such ([2b447a0](2b447a0))
* **graphql:** sanitize multipart files for cache ([4ceb800](4ceb800))
* **graphql:** simplified AuthLink ([0b3fbd9](0b3fbd9))
* **tests:** update tests ([bba4a7a](bba4a7a))

### Features

* cache now flags itself for broadcasting ([84cba43](84cba43))
* client.fetchMore utility for leveraging the fetch more logic results without using ObservableQuery ([814ccb3](814ccb3))
* documentNode -> document, dependency issues, reexport links from client (for now), retrieve subscription changes from [#533](#533) ([4fb205c](4fb205c))
* **graphql:** HiveStore.open ([6db4677](6db4677))
* drop Link layer in favor of package:gql_link and package:gql_exec ([2e491a7](2e491a7))
* **client:** add context to QueryResult ([fbc5a2d](fbc5a2d))
* **client:** cache proxy methods on cache, resetStore with optional refetchQueries ([ba7134a](ba7134a))
* **client:** cache writes are now strict, and throw PartialDataException (from normalize), ([616b5ed](616b5ed))
* **client:** CacheRereadPolicy, watchMutation workaround ([32e02da](32e02da))
* **client:** carry forward data on exception ([ccf3b9c](ccf3b9c))
* **client:** expose store, cleanup ([6fc5e7e](6fc5e7e))
* **client:** only rebroadcast on deep equals ([ee64e99](ee64e99))
* **client:** partialDataPolicy for configuring rejections ([0a7cd28](0a7cd28))
* **client:** QueryResult.unexecuted ([13e3257](13e3257))
* **client:** refetchSafeQueries, clarify rebroadcast calls in docs ([e45b240](e45b240))
* **docs:** v4 changelog ([38cfd9b](38cfd9b))
* **examples:** reorg graphql example so pub displays code ([bc32bdd](bc32bdd))
* **examples:** starwars hivestore usage ([2f874ec](2f874ec))
* **graphql:** add isMutation etc helpers to Options types ([04e7888](04e7888))
* **graphql:** complete caching overhaul ([e9b5660](e9b5660))
* **graphql:** HiveStore api improvements, fetchmore fixes ([2d1a7f2](2d1a7f2))
* **graphql:** multipart file support ([c2733ca](c2733ca))
* **graphql:** re-add documentNode asdeprecated ([20d0176](20d0176))
* more work on gql links ([0d7ef7a](0d7ef7a))
* **graphql:** Robust ObservableQuery docs ([1e893b5](1e893b5))
* **graphql:** update old websocket_link ([496d994](496d994))
* **graphql:** upgrade normalize to 0.4.2 ([4655e7d](4655e7d))
* **graphql:** use new cache correctly everywhere else ([f64a6c8](f64a6c8))
* starting on gql links ([d9452bc](d9452bc))
* **graphql:** work on making subscriptions more of a first-class citizen ([6d0b045](6d0b045))
* **graphql_flutter:** add ResultAccumulator, fix Subscription ([7e1edee](7e1edee))
* **graphql_flutter:** initHiveForFlutter ([1118cc7](1118cc7))
* HiveStore ([2c3c66c](2c3c66c))
* move to DocumentNode-only documents ([7499323](7499323))
* **graphql_flutter:** work on making subscriptions more of a first-class citizen ([a0e0d5c](a0e0d5c))
* **tests:** test subscriptions ([2a3e6a1](2a3e6a1))

### BREAKING CHANGES

* **client:** By fixing the defaults for mutations, the old behavior
is now lost
* the deprecated string documents are no longer supported
* Link layer is now implemented via package:gql_link and package:gql_exec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 📦 cache Relates to caching functionality
Projects
None yet
Development

No branches or pull requests

3 participants