self::get_input_fields(), 'outputFields' => self::get_output_fields(), 'mutateAndGetPayload' => [ Tax_Rate_Create::class, 'mutate_and_get_payload' ], ] ); } /** * Defines the mutation input field configuration * * @return array */ public static function get_input_fields() { return array_merge( Tax_Rate_Create::get_input_fields(), [ 'id' => [ 'type' => [ 'non_null' => 'Int' ], 'description' => static function () { return __( 'The ID of the tax rate to update.', 'graphql-for-ecommerce' ); }, ], ] ); } /** * Defines the mutation output field configuration * * @return array */ public static function get_output_fields() { return [ 'taxRate' => [ 'type' => 'TaxRate', 'resolve' => static function ( array $payload, array $args, AppContext $context ) { return $context->get_loader( 'tax_rate' )->load( $payload['tax_rate_id'] ); }, ], ]; } }