wp-graphql-woocommerce icon indicating copy to clipboard operation
wp-graphql-woocommerce copied to clipboard

Product mutations

Open kidunot89 opened this issue 5 years ago • 3 comments

Description

Mutations for manipulating Products and ProductVariations. Capability checks will be implemented so this mutations won't be usable for user without them.

Mutations

  • createProduct - creates a product
  • createVariation - creates a product variation
  • updateProduct - modifies an existing product
  • updateVariation - modiifies an existing product variation
  • deleteProduct - deletes a product
  • deleteVariation - deletes a product variation

kidunot89 avatar Apr 03 '19 02:04 kidunot89

Hi @kidunot89, any updates on this? I'll develop a quick code for this mutation as I need it for my headless app. Maybe it could be useful.

victormattosvm avatar May 17 '22 14:05 victormattosvm

@victormattosvm No progress has been made into this yet, it's been stalled due to other priorities and a lack of known interest/demand in this feature, and product querying still has some flaws and inconsistencies.

Introducing product mutations at this point could likely just add more bugs to the situation if those inconsistencies aren't resolved first, but I'll accept any solid PR with functionality.

kidunot89 avatar May 17 '22 17:05 kidunot89

@victormattosvm

Hi @kidunot89, any updates on this? I'll develop a quick code for this mutation as I need it for my headless app. Maybe it could be useful.

How is your code for mutation working for you? And care to share your code? or make PR to the main project?

I also need the ability to create products for one of my projects ..

hmm a temporary work-around, could be to use htlm2react to handle the creation and Modifications of Products https://www.npmjs.com/package/html-react-parser but i would rather use graphql directly.

Or could also use WooCommerce REST API just for the mutation of products function .. https://woocommerce.github.io/woocommerce-rest-api-docs/

ifoi avatar Oct 24 '22 20:10 ifoi