aboutsummaryrefslogtreecommitdiff
path: root/pages/lib/apolloClient.js
diff options
context:
space:
mode:
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 };