"availableShippingMethods" resolver updated.

This commit is contained in:
Geoff Taylor
2020-05-11 21:25:55 -04:00
parent d3c36d62a4
commit 59712dabbc
3 changed files with 2 additions and 2 deletions
+1
View File
@@ -136,6 +136,7 @@ class Cart_Type {
'description' => __( 'Available shipping methods for this order.', 'wp-graphql-woocommerce' ),
'resolve' => function() {
$packages = array();
foreach ( \WC()->shipping()->calculate_shipping( \WC()->cart->get_shipping_packages() ) as $index => $package ) {
$package['index'] = $index;
$packages[] = $package;
@@ -39,7 +39,7 @@ class Shipping_Rate_Type {
},
),
'instanceId' => array(
'type' => array( 'non_null' => 'Int' ),
'type' => 'Int',
'description' => __( 'Shipping instance ID', 'wp-graphql-woocommerce' ),
'resolve' => function ( $source ) {
return ! empty( $source->get_instance_id() ) ? $source->get_instance_id() : null;
-1
View File
@@ -23,7 +23,6 @@
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
define( 'GRAPHQL_DEBUG', true );
/**
* If the codeception remote coverage file exists, require it.
*