From 7a6eedab9d0fc322c1d55d4dbc6c8b9c869cf64f Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 5 Oct 2020 17:03:01 +0200 Subject: [PATCH] =?UTF-8?q?Forcer=20l'utilisation=20du=20r=C3=A9seau=20pou?= =?UTF-8?q?r=20les=20requ=C3=AAtes=20d'autorisation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/gql/queries/authorization.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/src/gql/queries/authorization.tsx b/client/src/gql/queries/authorization.tsx index 31293ee..52ecc65 100644 --- a/client/src/gql/queries/authorization.tsx +++ b/client/src/gql/queries/authorization.tsx @@ -8,10 +8,16 @@ export const QUERY_IS_AUTHORIZED = gql` `; export function useIsAuthorizedQuery>(options: QueryHookOptions = {}) { + options = Object.assign({ + fetchPolicy: 'cache-and-network' + }, options); return useQuery(QUERY_IS_AUTHORIZED, options); } export function useIsAuthorized>(options: QueryHookOptions = {}, defaultValue = false) { + options = Object.assign({ + fetchPolicy: 'cache-and-network' + }, options); const { data, loading, error } = useGraphQLData( QUERY_IS_AUTHORIZED, 'isAuthorized', defaultValue, options );