Automattic\WooCommerce\Vendor\GraphQL\Validator\Rules

QuerySecurityRule::gatherFragmentDefinitionprotectedWC 1.0

Method of the class: QuerySecurityRule{}

No Hooks.

Returns

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->gatherFragmentDefinition( $context ): void;
$context(QueryValidationContext) (required)
.

QuerySecurityRule::gatherFragmentDefinition() code WC 10.9.1

protected function gatherFragmentDefinition(QueryValidationContext $context): void
{
    // Gather all the fragment definition.
    // Importantly this does not include inline fragments.
    $definitions = $context->getDocument()->definitions;
    foreach ($definitions as $node) {
        if ($node instanceof FragmentDefinitionNode) {
            $this->fragments[$node->name->value] = $node;
        }
    }
}