Docs

Get Started

React Client Configuration#

The React Client has some configurations you can set manually:

// in your `destination` file specified by your gqty 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:

| Name | Type | Default Value | Description | | ------------------------- | ---------------------------------------------------------------------------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | suspense | boolean | false | Enable/Disable 'React Suspense' behavior for graphql HOC and useQuery | | lazyQuerySuspense | boolean | false | Enable/Disable 'React Suspense' behavior for useLazyQuery | | transactionQuerySuspense | boolean | inherited from suspense | Enable/Disable 'React Suspense' behavior for useTransactionQuery | | mutationSuspense | boolean | false | Enable/Disable 'React Suspense' behavior for useMutation | | preparedSuspense | boolean | inherited from suspense | Enable/Disable 'React Suspense' behavior for prepareQuery hooks | | paginatedQuerySuspense | boolean | false | Enable/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 | | staleWhileRevalidate | boolean | false | Enable/Disable 'stale-while-revalidate' behavior for graphql HOC & useQuery | | retry | RetryOptions | true | Retry on error behavior | | refetchAfterHydrate | boolean | false | Refetch after SSR Hydration |