#How to use QueryClientProvider in vue 3? i can't find it on the package

5 messages · Page 1 of 1 (latest)

dull heron
#

so guys i wan't to ask how can i use QueryClientProvider in vue 3 like react.. so i can apply inside app.vue as a wrapper, thank you

nimble crow
dull heron
#

Great! @nimble crow , so how can i config like in react like this

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      refetchOnWindowFocus: false,
    },
  },
})

function App() {
  return <QueryClientProvider client={queryClient}>...</QueryClientProvider>
}
nimble crow
#
const vueQueryPluginOptions: VueQueryPluginOptions = {
  queryClientConfig: {
    defaultOptions: { queries: { staleTime: 3600 } },
  },
};
app.use(VueQueryPlugin, vueQueryPluginOptions);