Merge pull request #403 from simPod/fix-conditions

Improve comparison in ReferenceExecutor
This commit is contained in:
Vladimir Razuvaev 2018-12-01 23:04:34 +07:00 committed by GitHub
commit 039577d9eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,7 +153,7 @@ class ReferenceExecutor implements ExecutorImplementation
break;
}
}
if (! $operation) {
if ($operation === null) {
if ($operationName) {
$errors[] = new Error(sprintf('Unknown operation named "%s".', $operationName));
} else {
@ -165,7 +165,7 @@ class ReferenceExecutor implements ExecutorImplementation
);
}
$variableValues = null;
if ($operation) {
if ($operation !== null) {
[$coercionErrors, $coercedVariableValues] = Values::getVariableValues(
$schema,
$operation->variableDefinitions ?: [],