protected function getReferencedFieldsAndFragmentNames(FragmentDefinitionNode $fragment): ComparisonContext
    {
        if ($this->cachedFieldsAndFragmentNames->offsetExists($fragment)) {
            return $this->cachedFieldsAndFragmentNames->offsetGet($fragment);
        }

        /** @var NamedTypeInterface $fragmentType */
        $fragmentType = TypeASTConverter::convert($this->getContext()->getSchema(), $fragment->getTypeCondition());

        return $this->getFieldsAndFragmentNames($fragment->getSelectionSet(), $fragmentType);
    }
protected function getReferencedFieldsAndFragmentNames(FragmentDefinitionNode $fragment): ComparisonContext
    {
        if ($this->cachedFieldsAndFragmentNames->offsetExists($fragment)) {
            return $this->cachedFieldsAndFragmentNames->offsetGet($fragment);
        }

        /** @var NamedTypeInterface $fragmentType */
        $fragmentType = TypeASTConverter::convert($this->getContext()->getSchema(), $fragment->getTypeCondition());

        return $this->getFieldsAndFragmentNames($fragment->getSelectionSet(), $fragmentType);
    }
protected function getReferencedFieldsAndFragmentNames ( FragmentDefinitionNode $ fragment ) : ComparisonContext { if ( $ this -> cachedFieldsAndFragmentNames -> offsetExists ( $ fragment ) ) { return $ this -> cachedFieldsAndFragmentNames -> offsetGet ( $ fragment ) ; } /** @var NamedTypeInterface $fragmentType */ $ fragmentType = TypeASTConverter :: convert ( $ this -> getContext ( ) -> getSchema ( ) , $ fragment -> getTypeCondition ( ) ) ; return $ this -> getFieldsAndFragmentNames ( $ fragment -> getSelectionSet ( ) , $ fragmentType ) ; }
Given a reference to a fragment, return the represented collection of fields
as well as a list of nested fragment names referenced via fragment spreads.

@param FragmentDefinitionNode $fragment
@return ComparisonContext
@throws InvalidTypeException
@throws ConversionException
@throws InvariantException
Given a reference to a fragment return the represented collection of fields as well as a list of nested fragment names referenced via fragment spreads .