mirror of
https://github.com/wp-graphql/wp-graphql-woocommerce.git
synced 2026-08-14 12:53:44 +02:00
"availableShippingMethods" resolver updated.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
// Exit if accessed directly.
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
define( 'GRAPHQL_DEBUG', true );
|
||||
/**
|
||||
* If the codeception remote coverage file exists, require it.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user