Skip to main content

React Client Configuration

The React Client has some configurations you can set manually:

// in your `destination` file specified by your gqless config
createReactClient<GeneratedSchema>(client, {
defaults: {
// Here
},
});

Defaults#

In most functions available through the React Client you have some options you can set.

The defaults value of some of them can be overriden here:

NameTypeDefault ValueDescription
suspensebooleanfalseEnable/Disable 'React Suspense' behavior for graphql HOC and useQuery
lazyQuerySuspensebooleanfalseEnable/Disable 'React Suspense' behavior for useLazyQuery
transactionQuerySuspensebooleaninherited from suspenseEnable/Disable 'React Suspense' behavior for useTransactionQuery
mutationSuspensebooleanfalseEnable/Disable 'React Suspense' behavior for useMutation
preparedSuspensebooleaninherited from suspenseEnable/Disable 'React Suspense' behavior for prepareQuery hooks
paginatedQuerySuspensebooleanfalseEnable/Disable 'React Suspense' behavior for prepareQuery hooks
transactionFetchPolicy"cache-and-network" or "cache-first" or "network-only" or "no-cache""cache-first"'fetchPolicy' of useTransactionQuery
lazyFetchPolicy"cache-and-network" or "network-only" or "no-cache""network-only"Partial 'fetchPolicy' of useLazyQuery
paginatedQueryFetchPolicy"cache-and-network" or "network-only" or "cache-first""cache-first"Partial 'fetchPolicy' of usePaginatedQuery
staleWhileRevalidatebooleanfalseEnable/Disable 'stale-while-revalidate' behavior for graphql HOC & useQuery
retryRetryOptionstrueRetry on error behavior
refetchAfterHydratebooleanfalseRefetch after SSR Hydration
Last updated on by github-actions[bot]