From 482b1c8db5cfeaa20d75ce92fcb10f3ca8433633 Mon Sep 17 00:00:00 2001 From: Factiven Date: Fri, 14 Apr 2023 00:07:02 +0700 Subject: Update 5th --- pages/lib/apolloClient.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pages/lib/apolloClient.js (limited to 'pages/lib/apolloClient.js') diff --git a/pages/lib/apolloClient.js b/pages/lib/apolloClient.js new file mode 100644 index 0000000..8a25156 --- /dev/null +++ b/pages/lib/apolloClient.js @@ -0,0 +1,20 @@ +import { ApolloClient, DefaultOptions, InMemoryCache } from "@apollo/client"; + +const defaultOptions = { + watchQuery: { + fetchPolicy: "no-cache", + errorPolicy: "ignore", + }, + query: { + fetchPolicy: "no-cache", + errorPolicy: "all", + }, +}; + +const client = new ApolloClient({ + uri: "https://graphql.anilist.co", + cache: new InMemoryCache(), + defaultOptions: defaultOptions, +}); + +export { client }; -- cgit v1.2.3