self::get_input_fields(), 'outputFields' => self::get_output_fields(), 'mutateAndGetPayload' => [ Product_Attribute_Term_Create::class, 'mutate_and_get_payload' ], ] ); } /** * Defines the mutation input field configuration * * @return array */ public static function get_input_fields() { return array_merge( Product_Attribute_Term_Create::get_input_fields(), [ 'id' => [ 'type' => [ 'non_null' => 'Int' ], 'description' => static function () { return __( 'The ID of the term to update.', 'graphql-for-ecommerce' ); }, ], 'name' => [ 'type' => 'String', 'description' => static function () { return __( 'The name of the term.', 'graphql-for-ecommerce' ); }, ], ] ); } /** * Defines the mutation output field configuration * * @return array */ public static function get_output_fields() { return [ 'term' => [ 'type' => 'ProductAttributeTermObject', 'resolve' => static function ( $payload ) { return (object) $payload['term']; }, ], ]; } }