• 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

89.8
/includes/type/object/class-order-note-type.php
1
<?php
2
/**
3
 * WPObject Type - Order_Note_Type
4
 *
5
 * Registers OrderNote WPObject type and queries
6
 *
7
 * @package WPGraphQL\WooCommerce\Type\WPObject
8
 * @since   TBD
9
 */
10

11
namespace WPGraphQL\WooCommerce\Type\WPObject;
12

13
use GraphQLRelay\Relay;
14

15
/**
16
 * Class Order_Note_Type
17
 */
18
class Order_Note_Type {
19
        /**
20
         * Register Order type and queries to the WPGraphQL schema
21
         *
22
         * @return void
23
         */
24
        public static function register() {
25
                register_graphql_object_type(
110✔
26
                        'OrderNote',
110✔
27
                        [
110✔
28
                                'interfaces'      => [ 'Node' ],
110✔
29
                                'eagerlyLoadType' => true,
110✔
30
                                'description'     => __( 'A order note', 'wp-graphql-woocommerce' ),
110✔
31
                                'fields'          => apply_filters( 'woographql_order_note_field_definitions', self::get_fields() ),
110✔
32
                        ]
110✔
33
                );
110✔
34
        }
35

36
        /**
37
         * Returns the "Order" type fields.
38
         *
39
         * @param array $other_fields Extra fields configs to be added or override the default field definitions.
40
         * @return array
41
         */
42
        public static function get_fields( $other_fields = [] ) {
43
                return array_merge(
110✔
44
                        [
110✔
45
                                'id'             => [
110✔
46
                                        'type'        => [ 'non_null' => 'ID' ],
110✔
47
                                        'description' => __( 'Database ID or global ID of the order note', 'wp-graphql-woocommerce' ),
110✔
48
                                        'resolve'     => static function ( $order_note ) {
110✔
UNCOV
49
                                                return Relay::toGlobalId( 'order_note', $order_note->databaseId );
×
50
                                        },
110✔
51
                                ],
110✔
52
                                'databaseId'     => [
110✔
53
                                        'type'        => 'Int',
110✔
54
                                        'description' => __( 'Database ID of the order note', 'wp-graphql-woocommerce' ),
110✔
55
                                        'resolve'     => static function ( $order_note ) {
110✔
UNCOV
56
                                                return $order_note->databaseId;
×
57
                                        },
110✔
58
                                ],
110✔
59
                                'dateCreated'    => [
110✔
60
                                        'type'        => 'String',
110✔
61
                                        'description' => __( 'The date the order note was created, in the site\'s timezone.', 'wp-graphql-woocommerce' ),
110✔
62
                                        'resolve'     => static function ( $order_note ) {
110✔
UNCOV
63
                                                return $order_note->date;
×
64
                                        },
110✔
65
                                ],
110✔
66
                                'note'           => [
110✔
67
                                        'type'        => 'String',
110✔
68
                                        'description' => __( 'Order note.', 'wp-graphql-woocommerce' ),
110✔
69
                                        'resolve'     => static function ( $order_note ) {
110✔
UNCOV
70
                                                return $order_note->contentRaw;
×
71
                                        },
110✔
72
                                ],
110✔
73
                                'isCustomerNote' => [
110✔
74
                                        'type'        => 'Boolean',
110✔
75
                                        'description' => __( 'Whether the note is a customer note', 'wp-graphql-woocommerce' ),
110✔
76
                                        'resolve'     => static function ( $order_note ) {
110✔
UNCOV
77
                                                return (bool) get_comment_meta( $order_note->databaseId, 'is_customer_note', true );
×
78
                                        },
110✔
79
                                ],
110✔
80
                        ],
110✔
81
                        $other_fields
110✔
82
                );
110✔
83
        }
84
}
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