Automattic\WooCommerce\Vendor\GraphQL\Utils

BreakingChangesFinder::findRemovedDirectivespublic staticWC 1.0

Method of the class: BreakingChangesFinder{}

No Hooks.

Returns

Array. Change>

Usage

$result = BreakingChangesFinder::findRemovedDirectives( $oldSchema, $newSchema ): array;
$oldSchema(Schema) (required)
.
$newSchema(Schema) (required)
.

BreakingChangesFinder::findRemovedDirectives() code WC 10.9.1

public static function findRemovedDirectives(Schema $oldSchema, Schema $newSchema): array
{
    $removedDirectives = [];

    $newSchemaDirectiveMap = self::getDirectiveMapForSchema($newSchema);
    foreach ($oldSchema->getDirectives() as $directive) {
        if (! isset($newSchemaDirectiveMap[$directive->name])) {
            $removedDirectives[] = [
                'type' => self::BREAKING_CHANGE_DIRECTIVE_REMOVED,
                'description' => "{$directive->name} was removed",
            ];
        }
    }

    return $removedDirectives;
}