Skip to content

Commit 2a8b4f6

Browse files
authored
Fix about cache policy in README.md
1 parent 65e667f commit 2a8b4f6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ import { GraphQLClient } from 'graphql-request'
2424
import { getSdkWithHooks } from './graphql'
2525

2626
const sdk = getSdkWithHooks(
27-
// Disable the cache because it is managed by `swr`.
28-
// In the case of SSG, the server side always fetches the latest data, so it is unnecessary.
29-
new GraphQLClient(`${process.env.API_URL}/graphql`, { cache: 'no-cache' })
27+
new GraphQLClient(`${process.env.API_URL}/graphql`, { cache: typeof window === 'object' ? 'default' : 'no-cache' })
3028
)
3129

3230
export default sdk

0 commit comments

Comments
 (0)