Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

apollo clear cache for query

const { data: cachedData } = useQuery(MyQuery, { fetchPolicy: 'cache-only', variables });
const [executeMyQuery, { data: queryData, loading, error }] = useLazyQuery(MyQuery, {
  fetchPolicy: 'network-only'
});
const data = queryData || cachedData;
 
PREVIOUS NEXT
Tagged: #apollo #clear #cache #query
ADD COMMENT
Topic
Name
9+2 =