Automattic\WooCommerce\Vendor\GraphQL\Utils

BuildSchema::getOperationTypes │ private │ WC 1.0

Method of the class: BuildSchema{}

No Hooks.

Returns

array<string, string>.

Usage

// private - for code of main (parent) class only
$result = $this->getOperationTypes( $schemaDef ): array;
$schemaDef(SchemaDefinitionNode) (required)
.

BuildSchema::getOperationTypes() code WC 11.1.2

private function getOperationTypes(SchemaDefinitionNode $schemaDef): array
{
    /** @var array<string, string> $operationTypes */
    $operationTypes = [];
    foreach ($schemaDef->operationTypes as $operationType) {
        $operationTypes[$operationType->operation] = $operationType->type->name->value;
    }

    return $operationTypes;
}