| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace Webkul\BagistoApi\Models;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\GraphQl\Mutation;
- use Webkul\BagistoApi\Dto\CartData;
- use Webkul\BagistoApi\Dto\SaveCheckoutCartInput;
- use Webkul\BagistoApi\State\SaveCheckoutCartProcessor;
- /**
- * SaveCheckoutCart - GraphQL API Resource for persisting checkout selections.
- *
- * Single mutation that saves shipping method, coupon code and payment method in
- * one call and returns the full cart. Any input field equal to "-1" is left
- * untouched. The cart is resolved from the Authorization: Bearer token.
- */
- #[ApiResource(
- routePrefix: '/api/shop',
- shortName: 'SaveCheckoutCart',
- uriTemplate: '/save-checkout-carts',
- operations: [],
- graphQlOperations: [
- new Mutation(
- name: 'create',
- input: SaveCheckoutCartInput::class,
- output: CartData::class,
- processor: SaveCheckoutCartProcessor::class,
- denormalizationContext: [
- 'allow_extra_attributes' => true,
- 'groups' => ['mutation'],
- ],
- normalizationContext: [
- 'groups' => ['mutation'],
- ],
- description: 'Save shipping method, coupon code and payment method for the cart and return the full cart. Pass "-1" for any field to leave it unchanged.',
- ),
- ]
- )]
- class SaveCheckoutCart {}
|