apollo-refetch-queries
v0.0.3
Published
This module includes some helper functions to allow you to refetch queries by name. It's been built against Apollo Client 2.0.
Readme
Apollo Refetch Queries
This module includes some helper functions to allow you to refetch queries by name. It's been built against Apollo Client 2.0.
Code originally taken from Apollo Client issue 3540
Installation
yarn add apollo-refetch-queriesnpm i apollo-refetch-queriesUsage
import * as queries from 'apollo-refetch-queries'
const query = gql`
query myNamedQuery {
topLevelQuery
}
`
queries.refetchQueriesByName(apolloClientInstance, ['myNamedQuery'])API
refetchQueriesByName (client: ApolloClient<any>, queryNames: Array<string>): Promise<any>
refetchQueryByName (client: ApolloClient<any>, queryName: string): Promise<any>
refetchAllQueries (client: ApolloClient<any>): Promise<any>
