📜  apoolo uselaxyQuery 绕过缓存 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:31.360000             🧑  作者: Mango

代码示例1
const { data: cachedData } = useQuery(MyQuery, { fetchPolicy: 'cache-only', variables });
const [executeMyQuery, { data: queryData, loading, error }] = useLazyQuery(MyQuery, {
  fetchPolicy: 'network-only'
});
const data = queryData || cachedData;