Skip to content

Commit

Permalink
fix: enable persisted queries when option is true, resolves #240 (#242
Browse files Browse the repository at this point in the history
)

* fix: enable persisted queries when option is `true`, resolves #240

* fix: do not require an `enabled` property to avoid conflicts
  • Loading branch information
nether-cat authored and Akryum committed Oct 21, 2019
1 parent da24a24 commit dfbad34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ createApolloClient({
// Enable this if you use Query persisting with Apollo Engine
persisting: false,
// Or, advanced persisting options, see https://github.com/apollographql/apollo-link-persisted-queries#options
// Example:
// persisting: {
// enabled: false,
// generateHash: query => sha256()
// .update(print(query))
// .digest('hex'),
Expand Down
3 changes: 2 additions & 1 deletion graphql-client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ export function createApolloClient ({
let persistingOpts = {}
if (typeof persisting === 'object' && persisting != null) {
persistingOpts = persisting
persisting = true
}
if (persistingOpts.enabled) {
if (persisting === true) {
link = createPersistedQueryLink(persistingOpts).concat(link)
}
}
Expand Down

0 comments on commit dfbad34

Please sign in to comment.