Forcer l'utilisation du réseau pour les requêtes d'autorisation
This commit is contained in:
parent
89a147565c
commit
7a6eedab9d
|
@ -8,10 +8,16 @@ export const QUERY_IS_AUTHORIZED = gql`
|
|||
`;
|
||||
|
||||
export function useIsAuthorizedQuery<A = any, R = Record<string, any>>(options: QueryHookOptions<A, R> = {}) {
|
||||
options = Object.assign({
|
||||
fetchPolicy: 'cache-and-network'
|
||||
}, options);
|
||||
return useQuery(QUERY_IS_AUTHORIZED, options);
|
||||
}
|
||||
|
||||
export function useIsAuthorized<A = any, R = Record<string, any>>(options: QueryHookOptions<A, R> = {}, defaultValue = false) {
|
||||
options = Object.assign({
|
||||
fetchPolicy: 'cache-and-network'
|
||||
}, options);
|
||||
const { data, loading, error } = useGraphQLData<boolean>(
|
||||
QUERY_IS_AUTHORIZED, 'isAuthorized', defaultValue, options
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue