ArrayOf.php
2 months ago
ConnectionOf.php
2 months ago
Deprecated.php
2 months ago
Description.php
2 months ago
Experimental.php
4 weeks ago
HiddenFromMetadataQuery.php
4 weeks ago
Ignore.php
2 months ago
Internal.php
4 weeks ago
Metadata.php
4 weeks ago
Name.php
2 months ago
Parameter.php
2 months ago
ParameterDescription.php
2 months ago
PublicAccess.php
4 weeks ago
RequiredCapability.php
4 weeks ago
ReturnType.php
2 months ago
ScalarType.php
2 months ago
Unroll.php
2 months ago
ConnectionOf.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Automattic\WooCommerce\Api\Attributes; |
| 6 | |
| 7 | use Attribute; |
| 8 | |
| 9 | /** |
| 10 | * Marks a query's return type as a Relay-style connection of the given node type. |
| 11 | * |
| 12 | * Applied to the `execute()` method of a query class that returns a `Connection`. |
| 13 | * The builder uses this to generate the corresponding connection and edge GraphQL |
| 14 | * types (e.g. `CouponConnection`, `CouponEdge`) and to wire the correct return |
| 15 | * type in the schema. |
| 16 | */ |
| 17 | #[Attribute] |
| 18 | final class ConnectionOf { |
| 19 | /** |
| 20 | * Constructor. |
| 21 | * |
| 22 | * @param string $type The fully-qualified class name of the node type |
| 23 | * (e.g. `Coupon::class`). |
| 24 | */ |
| 25 | public function __construct( |
| 26 | public readonly string $type, |
| 27 | ) { |
| 28 | } |
| 29 | } |
| 30 |