We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b2cd764 + 2a8b4f6 commit afffc8bCopy full SHA for afffc8b
README.md
@@ -24,9 +24,7 @@ import { GraphQLClient } from 'graphql-request'
24
import { getSdkWithHooks } from './graphql'
25
26
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' })
+ new GraphQLClient(`${process.env.API_URL}/graphql`, { cache: typeof window === 'object' ? 'default' : 'no-cache' })
30
)
31
32
export default sdk
0 commit comments