Add a global fetch policy config for graphql clients

This commit is contained in:
Hazem Krimi
2023-06-04 15:34:23 +01:00
parent 90ad62d41f
commit e7d1d81be0
8 changed files with 22 additions and 22 deletions
+3 -7
View File
@@ -103,9 +103,7 @@ const TemplateSettings = () => {
const { data: categories, loading: categoriesLoading } = useQuery<
GetAllCategoriesQuery,
GetAllCategoriesQueryVariables
>(GET_ALL_CATEGORIES, {
fetchPolicy: 'network-only',
});
>(GET_ALL_CATEGORIES);
const [getFeatures, { loading: featuresLoading }] = useLazyQuery<
GetAllFeaturesQuery,
@@ -113,8 +111,7 @@ const TemplateSettings = () => {
>(GET_ALL_FEATURES, {
onCompleted({ getAllFeatures }) {
setAvailableFeatures(getAllFeatures);
},
fetchPolicy: 'network-only',
}
});
const [getTemplate, { loading: templateLoading }] = useLazyQuery<
@@ -123,8 +120,7 @@ const TemplateSettings = () => {
>(GET_TEMPLATE_BY_ID, {
onCompleted({ getTemplateById }) {
setTemplate(getTemplateById);
},
fetchPolicy: 'network-only',
}
});
const [updateTemplate, { loading }] = useMutation<