Code Duplication    Length = 5-8 lines in 2 locations

src/Execution/Processor.php 1 location

@@ 303-310 (lines=8) @@
300
        $currentType  = $queryType->getNullableType();
301
302
303
        if ($currentType->getKind() == TypeMap::KIND_SCALAR) {
304
            if (!$query->hasFields()) {
305
                return $this->getOutputValue($currentType, $resolvedValue);
306
            } else {
307
                $this->executionContext->addError(new ResolveException(sprintf('Fields are not found in query "%s"', $query->getName())));
308
309
                return null;
310
            }
311
        }
312
313
        foreach ($query->getFields() as $fieldAst) {

src/Validator/ResolveValidator/ResolveValidator.php 1 location

@@ 203-207 (lines=5) @@
200
        }
201
202
        $fieldType = $this->resolveTypeIfAbstract($fieldType->getNullableType(), $value);
203
        if (!$fieldType->isValidValue($value)) {
204
            $this->executionContext->addError(new ResolveException(sprintf('Not valid value for %s field %s', $fieldType->getNullableType()->getKind(), $field->getName())));
205
206
            return false;
207
        }
208
209
        return true;
210
    }