wp-graphql-woocommerce
wp-graphql-woocommerce copied to clipboard
Decimal Product Quantities
Is it possible to force edit field type for the schema?
I installed plugin 'Decimal Product Quantities' but GraphqQL Schema still requires quantity in addToCart to be Int.
@mruknowme You'd have to deregister and register the quantity field across the schema.
This includes both the CartItemInput field and CartItem field.
You have to unregister the Int type fields using the deregister_graphql_field() function, and register Float type fields with register_graphql_field()
Thanks for the information, will read about it and give it a try
Just confirming that your suggestion worked, though I also had to de-register and register with Float additionally the following:
deregister_graphql_field('CartItemQuantityInput', 'quantity');
deregister_graphql_field('LineItem', 'quantity');
deregister_graphql_field('LineItemInput', 'quantity');
deregister_graphql_field('CartToCartItemConnection', 'itemCount');