Skip to content

Commit 086b486

Browse files
author
Guillaume Chau
committed
Fix #101
1 parent 1d580a4 commit 086b486

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/apollo-provider.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,19 @@ export class ApolloProvider {
103103
result = prefetch
104104
}
105105

106-
const optVariables = queryOptions.variables
107-
108106
if (!result) {
109107
return Promise.resolve()
110-
} else if (prefetchType === 'boolean' && typeof optVariables !== 'undefined') {
111-
// Reuse `variables` option with `prefetch: true`
112-
if (typeof optVariables === 'function') {
113-
variables = optVariables.call(context)
108+
} else if (prefetchType === 'boolean') {
109+
const optVariables = queryOptions.variables
110+
if (typeof optVariables !== 'undefined') {
111+
// Reuse `variables` option with `prefetch: true`
112+
if (typeof optVariables === 'function') {
113+
variables = optVariables.call(context)
114+
} else {
115+
variables = optVariables
116+
}
114117
} else {
115-
variables = optVariables
118+
variables = undefined
116119
}
117120
} else {
118121
variables = result

0 commit comments

Comments
 (0)