Skip to content

Commit

Permalink
Correctly configure the tRPC query client
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Jun 30, 2023
1 parent 7730684 commit 25aea07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
11 changes: 10 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ export interface MyAppProps extends AppProps {
}

function MyApp({ Component, emotionCache = clientSideEmotionCache, pageProps }: MyAppProps) {
const [queryClient] = React.useState(() => new QueryClient());
const [queryClient] = React.useState(() => new QueryClient({
defaultOptions: {
queries: {
retry: false,
},
mutations: {
retry: false,
},
},
}));
return <>
<CacheProvider value={emotionCache}>
<Head>
Expand Down
9 changes: 0 additions & 9 deletions src/modules/trpc/trpc.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,6 @@ export const apiQuery = createTRPCNext<AppRouter>({
url: `${getBaseUrl()}/api/trpc`,
}),
],

// change options globally
queryClientConfig: {
defaultOptions: {
queries: {
retry: false, // TODO: enable retries in production?
},
},
},
};
},
/**
Expand Down

1 comment on commit 25aea07

@vercel
Copy link

@vercel vercel bot commented on 25aea07 Jun 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

big-agi – ./

big-agi-git-main-enricoros.vercel.app
big-agi-enricoros.vercel.app
get.big-agi.com

Please sign in to comment.