aboutsummaryrefslogtreecommitdiff
path: root/lib/apolloClient.js
diff options
context:
space:
mode:
authorFactiven <[email protected]>2023-04-11 23:23:29 +0700
committerFactiven <[email protected]>2023-04-11 23:23:29 +0700
commit1fcdd9f7d859b925bf92265f441655d5522e351c (patch)
tree86391522f6fcc70d105f7e796a9f91d132ee4a29 /lib/apolloClient.js
parentInitial commit (diff)
downloadmoopa-1fcdd9f7d859b925bf92265f441655d5522e351c.tar.xz
moopa-1fcdd9f7d859b925bf92265f441655d5522e351c.zip
initial commit
Diffstat (limited to 'lib/apolloClient.js')
-rw-r--r--lib/apolloClient.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/apolloClient.js b/lib/apolloClient.js
new file mode 100644
index 0000000..8a25156
--- /dev/null
+++ b/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 };