• 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

66.67
/includes/connection/class-posts.php
1
<?php
2
/**
3
 * Connection type - Posts
4
 *
5
 * Registers connections to Posts
6
 *
7
 * @package WPGraphQL\WooCommerce\Connection
8
 */
9

10
namespace WPGraphQL\WooCommerce\Connection;
11

12
use GraphQL\Type\Definition\ResolveInfo;
13
use WPGraphQL\AppContext;
14
use WPGraphQL\Data\Connection\PostObjectConnectionResolver;
15
use WPGraphQL\Type\Connection\PostObjects;
16

17
/**
18
 * Class - Posts
19
 */
20
class Posts extends PostObjects {
21
        /**
22
         * Registers the various connections from other WooCommerce Types to other WordPress post-types.
23
         */
24
        public static function register_connections() {
25
                register_graphql_connection(
110✔
26
                        self::get_connection_config(
110✔
27
                                get_post_type_object( 'attachment' ),
110✔
28
                                [
110✔
29
                                        'fromType'      => 'Product',
110✔
30
                                        'toType'        => 'MediaItem',
110✔
31
                                        'fromFieldName' => 'galleryImages',
110✔
32
                                        'resolve'       => static function ( $source, array $args, AppContext $context, ResolveInfo $info ) {
110✔
UNCOV
33
                                                $resolver = new PostObjectConnectionResolver( $source, $args, $context, $info, 'attachment' );
×
UNCOV
34
                                                $resolver->set_query_arg( 'post_type', 'attachment' );
×
UNCOV
35
                                                $resolver->set_query_arg( 'post__in', $source->gallery_image_ids );
×
36

37
                                                // Change default ordering.
UNCOV
38
                                                if ( ! in_array( 'orderby', array_keys( $resolver->get_query_args() ), true ) ) {
×
UNCOV
39
                                                        $resolver->set_query_arg( 'orderby', 'post__in' );
×
40
                                                }
41

UNCOV
42
                                                return $resolver->get_connection();
×
43
                                        },
110✔
44
                                ]
110✔
45
                        )
110✔
46
                );
110✔
47
        }
48
}
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