Skip to content

Commit dfbad34

Browse files
nether-catAkryum
authored andcommitted
fix: enable persisted queries when option is true, resolves #240 (#242)
* fix: enable persisted queries when option is `true`, resolves #240 * fix: do not require an `enabled` property to avoid conflicts
1 parent da24a24 commit dfbad34

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/guide/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ createApolloClient({
1313
// Enable this if you use Query persisting with Apollo Engine
1414
persisting: false,
1515
// Or, advanced persisting options, see https://github.com/apollographql/apollo-link-persisted-queries#options
16+
// Example:
1617
// persisting: {
17-
// enabled: false,
1818
// generateHash: query => sha256()
1919
// .update(print(query))
2020
// .digest('hex'),

graphql-client/src/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,9 @@ export function createApolloClient ({
103103
let persistingOpts = {}
104104
if (typeof persisting === 'object' && persisting != null) {
105105
persistingOpts = persisting
106+
persisting = true
106107
}
107-
if (persistingOpts.enabled) {
108+
if (persisting === true) {
108109
link = createPersistedQueryLink(persistingOpts).concat(link)
109110
}
110111
}

0 commit comments

Comments
 (0)