Skip to content

Commit

Permalink
Merge branch 'main' of github.com:croutonn/graphql-codegen-plugin-typ…
Browse files Browse the repository at this point in the history
…escript-swr into main
  • Loading branch information
croutonn committed Oct 19, 2020
2 parents b2cd764 + 2a8b4f6 commit afffc8b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ import { GraphQLClient } from 'graphql-request'
import { getSdkWithHooks } from './graphql'

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

export default sdk
Expand Down

0 comments on commit afffc8b

Please sign in to comment.