CustomScalarType.php
1 month ago
EnumType.php
1 month ago
Error.php
1 month ago
InputObjectType.php
1 month ago
InterfaceType.php
1 month ago
ObjectType.php
1 month ago
Schema.php
1 month ago
Type.php
1 month ago
aliases.php
1 month ago
aliases.php
27 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Class-alias bootstrap for the Api\Infrastructure\Schema surface. |
| 4 | * |
| 5 | * Some symbols in the surface — ResolveInfo and StringValueNode — cannot be |
| 6 | * subclasses because the GraphQL engine constructs them itself and hands them |
| 7 | * to resolver code. A subclass would be a distinct type and fail resolver |
| 8 | * parameter type-hint checks. Instead we register them as class_alias of |
| 9 | * their engine counterparts so the two FQCNs resolve to the same class. |
| 10 | * |
| 11 | * This file is loaded eagerly via composer's `autoload.files` entry (which |
| 12 | * the Jetpack autoloader in turn exposes through its filemap), so the aliases |
| 13 | * are available before any resolver is invoked. |
| 14 | */ |
| 15 | |
| 16 | declare(strict_types=1); |
| 17 | |
| 18 | class_alias( |
| 19 | \Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\ResolveInfo::class, |
| 20 | 'Automattic\\WooCommerce\\Api\\Infrastructure\\Schema\\ResolveInfo' |
| 21 | ); |
| 22 | |
| 23 | class_alias( |
| 24 | \Automattic\WooCommerce\Vendor\GraphQL\Language\AST\StringValueNode::class, |
| 25 | 'Automattic\\WooCommerce\\Api\\Infrastructure\\Schema\\AST\\StringValueNode' |
| 26 | ); |
| 27 |