zgl 1 周之前
父節點
當前提交
b3b7166c19
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/lib/graphql-fetch.ts

+ 6 - 1
src/lib/graphql-fetch.ts

@@ -127,8 +127,13 @@ export async function graphqlRequest<
     queryOption = {
       query,
       variables,
-      context: options?.context,
       fetchPolicy: "no-cache", // 跳过 apollo client 的缓存,直接调fetch
+      context: {
+        ...options?.context,
+        fetchOptions: {
+          cache: 'no-store',   // 👈 告诉 Next.js 不要缓存这个 fetch
+        },
+      },
     };
   }