Crates.io | artemis-normalized-cache |
lib.rs | artemis-normalized-cache |
version | 0.1.1 |
source | src |
created_at | 2020-04-09 22:03:28.799821 |
updated_at | 2021-03-06 13:33:51.230697 |
description | A graph-based normalized cache exchange for the artemis crate. |
homepage | |
repository | https://github.com/wingertge/artemis.git |
max_upload_size | |
id | 228159 |
size | 6,563,725 |
This is a normalized cache exchange for the artemis
GraphQL Client.
This is a drop-in replacement for the default [CacheExchange
] that, instead of document
caching, caches normalized data by keys and connections between data.
artemis
is already quite a comprehensive GraphQL client. However in several cases it may be
desirable to have data update across the entirety of an app when a response updates some known
pieces of data.
After installing this crate, change the default artemis
Client like from something like this:
let client = artemis::ClientBuilder::new("http://0.0.0.0")
.with_default_exchanges()
.build();
to this
use artemis::default_exchanges::{FetchExchange, DedupExchange};
use artemis_normalized_cache::NormalizedCacheExchange;
let client = artemis::ClientBuilder::new("http://0.0.0.0")
.with_exchange(FetchExchange)
.with_exchange(NormalizedCacheExchange::new())
.with_exchange(DedupExchange)
.build();
TODO: Don't steal urlq's docs you plagiarist