pub struct QueryStore { /* private fields */ }Expand description
A reference to the store used to run custom query updates
Implementations§
Source§impl QueryStore
impl QueryStore
Sourcepub fn update_query<'a, Q: GraphQLQuery, F>(
&'a self,
_query: Q,
variables: Q::Variables,
updater_fn: F,
dependencies: &mut HashSet<String>,
)
pub fn update_query<'a, Q: GraphQLQuery, F>( &'a self, _query: Q, variables: Q::Variables, updater_fn: F, dependencies: &mut HashSet<String>, )
Run a custom update function against the cache.
§Parameters
_query- TheGraphQLQueryobject for the query you want to update.variables- TheVariablesfor the query you want to update. It will only update cached results for that set of variables.updater_fn- The custom updater function. This takes in anOption<ResponseData>that represents the current state and should return anOption<ResponseData>that represents the new state.Nonemeans deleting the entry in this context. The current state is cloned, so feel free to modify and return it.dependencies- This is passed into the update closure and should simply be passed through.
Trait Implementations§
Source§impl Clone for QueryStore
impl Clone for QueryStore
Source§fn clone(&self) -> QueryStore
fn clone(&self) -> QueryStore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueryStore
impl !RefUnwindSafe for QueryStore
impl Send for QueryStore
impl Sync for QueryStore
impl Unpin for QueryStore
impl !UnwindSafe for QueryStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more