5 Commits
Author SHA1 Message Date
Geoff TaylorandGitHub e361dddff7 fix: make name optional in updateProduct mutation (#1014)
* fix: make name optional in updateProduct mutation

The UpdateProductInput inherited name as non_null from CreateProductInput,
requiring callers to always provide a name even when only updating other
fields. Now name is optional for updates — the existing name is preserved
when not provided.

* chore: Linter compliances met
2026-04-02 18:59:48 -04:00
Geoff TaylorandGitHub b6576d4125 feat: Product and product attribute mutations (#851)
* devops: Product and product attribute mutation tests generated

* feat: Product Mutations implemented and tested

* chore: Linter and PHPStan compliance met

* fix: resolve test failures in product and variation mutation tests

- Removed duplicate requires for payment-method classes (rebase artifact)
- Wrapped bare `attributes` queries in `... on SimpleProduct` inline
  fragments (attributes field is on ProductWithAttributes interface,
  not the base Product type)
- Fixed attribute label expectations to match factory output (lowercase)
- Fixed relay ID prefix from 'product'/'product_variation' to 'post'
  to match WPGraphQL's actual encoding
- Cache WP_Post before force-deletion and re-cache after so the Product
  model's type resolver can still determine the GraphQL type in the
  response
- Added wp_cache_flush() before asserting product deletion to avoid
  false positives from the re-cached post

* chore: fix PHPCS lint errors in mutation files

* fix: resolve CI test failures for attribute and variation mutations

- Fixed ProductVariation type registration in schema filters so the
  variation mutation output field resolves correctly
- Renamed attribute slug from 'pattern' to 'fabric' in
  ProductAttributeMutationsTest to avoid collision with the pattern
  attribute created by ProductAttributeQueriesTest
- Fixed PHPStan errors for redundant is_wp_error checks
- Updated IntrospectionQueryTest
2026-03-20 13:31:13 -04:00
Geoff Taylor 4e4654c540 CouponQueriesTest refactored. Unneeded tests removed. 2019-04-13 00:46:16 -04:00
Geoff Taylor 9949927b2b clean-up started 2019-03-21 21:43:24 -04:00
Geoff Taylor 0db77c26ab initial commit 2019-03-13 12:31:37 -04:00