• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wp-graphql / wp-graphql-woocommerce / 23675172456

28 Mar 2026 02:10AM UTC coverage: 70.983% (-18.4%) from 89.424%
23675172456

Pull #1003

github

web-flow
Merge 05339093d into 6fb7b226f
Pull Request #1003: devops: WC email template tests, COT cursor HPOS fix, checkout account auth

71 of 81 new or added lines in 5 files covered. (87.65%)

3346 existing lines in 124 files now uncovered.

12576 of 17717 relevant lines covered (70.98%)

55.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.91
/includes/type/object/class-refund-type.php
1
<?php
2
/**
3
 * WPObject Type - Refund_Type
4
 *
5
 * Registers Refund WPObject type and queries
6
 *
7
 * @package WPGraphQL\WooCommerce\Type\WPObject
8
 * @since   0.0.1
9
 */
10

11
namespace WPGraphQL\WooCommerce\Type\WPObject;
12

13
use WPGraphQL\AppContext;
14

15
/**
16
 * Class Refund_Type
17
 */
18
class Refund_Type {
19
        /**
20
         * Register Refund type and queries to the WPGraphQL schema.
21
         *
22
         * @return void
23
         */
24
        public static function register() {
25
                register_graphql_object_type(
110✔
26
                        'Refund',
110✔
27
                        [
110✔
28
                                'description' => __( 'A refund object', 'wp-graphql-woocommerce' ),
110✔
29
                                'interfaces'  => [ 'Node' ],
110✔
30
                                'fields'      => [
110✔
31
                                        'id'         => [
110✔
32
                                                'type'        => [ 'non_null' => 'ID' ],
110✔
33
                                                'description' => __( 'The globally unique identifier for the refund', 'wp-graphql-woocommerce' ),
110✔
34
                                        ],
110✔
35
                                        'databaseId' => [
110✔
36
                                                'type'        => 'Int',
110✔
37
                                                'description' => __( 'The ID of the refund in the database', 'wp-graphql-woocommerce' ),
110✔
38
                                        ],
110✔
39
                                        'title'      => [
110✔
40
                                                'type'        => 'String',
110✔
41
                                                'description' => __( 'A title for the new post type', 'wp-graphql-woocommerce' ),
110✔
42
                                        ],
110✔
43
                                        'amount'     => [
110✔
44
                                                'type'        => 'Float',
110✔
45
                                                'description' => __( 'Refunded amount', 'wp-graphql-woocommerce' ),
110✔
46
                                        ],
110✔
47
                                        'reason'     => [
110✔
48
                                                'type'        => 'String',
110✔
49
                                                'description' => __( 'Reason for refund', 'wp-graphql-woocommerce' ),
110✔
50
                                        ],
110✔
51
                                        'refundedBy' => [
110✔
52
                                                'type'        => 'User',
110✔
53
                                                'description' => __( 'User who completed the refund', 'wp-graphql-woocommerce' ),
110✔
54
                                                'resolve'     => static function ( $source, array $args, AppContext $context ) {
110✔
UNCOV
55
                                                        $user_id = absint( $source->refunded_by_id );
×
UNCOV
56
                                                        if ( 0 !== $user_id ) {
×
UNCOV
57
                                                                return $context->get_loader( 'user' )->load( $user_id );
×
58
                                                        }
UNCOV
59
                                                        return null;
×
60
                                                },
110✔
61
                                        ],
110✔
62
                                        'date'       => [
110✔
63
                                                'type'        => 'String',
110✔
64
                                                'description' => __( 'The date of the refund', 'wp-graphql-woocommerce' ),
110✔
65
                                        ],
110✔
66

67
                                        'metaData'   => Meta_Data_Type::get_metadata_field_definition(),
110✔
68
                                ],
110✔
69
                        ]
110✔
70
                );
110✔
71
        }
72
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc