Automattic\WooCommerce\Vendor\GraphQL\Utils

BuildSchema::getOperationTypesprivateWC 1.0

Method of the class: BuildSchema{}

No Hooks.

Returns

Array. string>

Usage

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

BuildSchema::getOperationTypes() code WC 10.9.1

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;
}