GraphQL\Validator\Rules\OverlappingFieldsCanBeMerged::getSubfieldMap PHP Method

getSubfieldMap() private method

private getSubfieldMap ( FieldNode $ast1, $type1, FieldNode $ast2, $type2, ValidationContext $context )
$ast1 GraphQL\Language\AST\FieldNode
$ast2 GraphQL\Language\AST\FieldNode
$context GraphQL\Validator\ValidationContext
    private function getSubfieldMap(FieldNode $ast1, $type1, FieldNode $ast2, $type2, ValidationContext $context)
    {
        $selectionSet1 = $ast1->selectionSet;
        $selectionSet2 = $ast2->selectionSet;
        if ($selectionSet1 && $selectionSet2) {
            $visitedFragmentNames = new \ArrayObject();
            $subfieldMap = $this->collectFieldNodesAndDefs($context, Type::getNamedType($type1), $selectionSet1, $visitedFragmentNames);
            $subfieldMap = $this->collectFieldNodesAndDefs($context, Type::getNamedType($type2), $selectionSet2, $visitedFragmentNames, $subfieldMap);
            return $subfieldMap;
        }
    }