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

AxeWP / wp-graphql-rank-math / 13344501037

15 Feb 2025 11:11AM UTC coverage: 89.142% (+0.2%) from 88.927%
13344501037

Pull #115

github

web-flow
Merge 0db7237b2 into 4cd0d407f
Pull Request #115: Fix WooGraphQL Product Type Expectations

0 of 11 new or added lines in 1 file covered. (0.0%)

2 existing lines in 1 file now uncovered.

2586 of 2901 relevant lines covered (89.14%)

11.43 hits per line

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

0.0
/src/Extensions/WPGraphQLWooCommerce/Type/WPObject/SeoObjects.php
1
<?php
2
/**
3
 * Registers the SEO objects for WPGraphQL for WooCommerce.
4
 *
5
 * @package WPGraphQL\RankMath\Extensions\WPGraphQLWooCommerce\Type\WPObject
6
 * @since 0.3.1
7
 */
8

9
declare( strict_types = 1 );
10

11
namespace WPGraphQL\RankMath\Extensions\WPGraphQLWooCommerce\Type\WPObject;
12

13
use WPGraphQL\RankMath\Utils\Utils;
14
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Interfaces\Registrable;
15
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Traits\TypeNameTrait;
16
use WPGraphQL\WooCommerce\WP_GraphQL_WooCommerce;
17

18
/**
19
 * Class - SeoObjects
20
 */
21
class SeoObjects implements Registrable {
22
        use TypeNameTrait;
23

24
        /**
25
         * {@inheritDoc}
26
         */
27
        public static function init(): void {
UNCOV
28
                add_action( 'graphql_register_types', [ static::class, 'register' ] );
×
29
        }
30

31
        /**
32
         * Registers the SEO GraphQL objects to the schema.
33
         */
34
        public static function register(): void {
35
                // Set SEO field types for product children.
NEW
UNCOV
36
                $product_types = array_merge(
×
NEW
37
                        WP_GraphQL_WooCommerce::get_enabled_product_types(),
×
38
                        [
×
NEW
39
                                'ProductUnion',
×
NEW
40
                                'ProductWithPricing',
×
NEW
41
                                'ProductWithDimensions',
×
NEW
42
                                'InventoriedProduct',
×
NEW
43
                                'DownloadableProduct',
×
NEW
44
                                'ProductWithAttributes',
×
NEW
45
                                'ProductWithVariations',
×
46
                        ]
×
47
                );
×
48

NEW
49
                foreach ( $product_types as $graphql_type_name ) {
×
NEW
50
                        Utils::overload_graphql_field_type( $graphql_type_name, 'seo', 'RankMathProductObjectSeo' );
×
51
                }
52
        }
53
}
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