This commit is contained in:
Guillaume Chau
2017-08-28 16:49:50 +02:00
parent 1d580a4969
commit 086b486bd7
+10 -7
View File
@@ -103,16 +103,19 @@ export class ApolloProvider {
result = prefetch
}
const optVariables = queryOptions.variables
if (!result) {
return Promise.resolve()
} else if (prefetchType === 'boolean' && typeof optVariables !== 'undefined') {
// Reuse `variables` option with `prefetch: true`
if (typeof optVariables === 'function') {
variables = optVariables.call(context)
} else if (prefetchType === 'boolean') {
const optVariables = queryOptions.variables
if (typeof optVariables !== 'undefined') {
// Reuse `variables` option with `prefetch: true`
if (typeof optVariables === 'function') {
variables = optVariables.call(context)
} else {
variables = optVariables
}
} else {
variables = optVariables
variables = undefined
}
} else {
variables = result