aboutsummaryrefslogtreecommitdiff
path: root/pages/lib/apolloClient.js
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-04-14 00:07:02 +0700
committerFactiven <[email protected]>2023-04-14 00:07:02 +0700
commit482b1c8db5cfeaa20d75ce92fcb10f3ca8433633 (patch)
treef0c12d3acb6bd8ce43e63e01527c97a62dba7e9c /pages/lib/apolloClient.js
parentUpdate index.js (diff)
downloadmoopa-482b1c8db5cfeaa20d75ce92fcb10f3ca8433633.tar.xz
moopa-482b1c8db5cfeaa20d75ce92fcb10f3ca8433633.zip
Update 5th
Diffstat (limited to 'pages/lib/apolloClient.js')
-rw-r--r--pages/lib/apolloClient.js20
1 files changed, 20 insertions, 0 deletions
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 };