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

AxeWP / wp-graphql-rank-math / 15507492505

07 Jun 2025 11:44AM UTC coverage: 86.429% (-2.0%) from 88.44%
15507492505

push

github

web-flow
dev: add support for lazy-loading `description`/`deprecationReason` config values (#121)

* chore: update strauss and deps

* dev: use callable descriptions/deprecations

* fix: dont prefix `NodeWithRankMathSeo`

* chore: fix backcompat on connections

* chore: update dep

* chore: update deps

* tests: ensure schema can build

* chore: update and cleanup

* fix: regenerate autoloader

357 of 367 new or added lines in 66 files covered. (97.28%)

60 existing lines in 60 files now uncovered.

2541 of 2940 relevant lines covered (86.43%)

11.49 hits per line

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

75.0
/src/Type/WPInterface/ContentNodeSeo.php
1
<?php
2
/**
3
 * Interface for ContentNode Seo fields.
4
 *
5
 * @package WPGraphQL\RankMath\Type\WPInterface
6
 * @since 0.0.8
7
 */
8

9
declare( strict_types = 1 );
10

11
namespace WPGraphQL\RankMath\Type\WPInterface;
12

13
use WPGraphQL\RankMath\Type\WPObject\SeoScore;
14
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Abstracts\InterfaceType;
15
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Interfaces\TypeWithInterfaces;
16
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Traits\TypeResolverTrait;
17

18
/**
19
 * Class - ContentNodeSeo
20
 */
21
class ContentNodeSeo extends InterfaceType implements TypeWithInterfaces {
22
        use TypeResolverTrait;
23

24
        /**
25
         * {@inheritDoc}
26
         */
27
        protected static function type_name(): string {
28
                return 'ContentNodeSeo';
20✔
29
        }
30

31
        /**
32
         * {@inheritDoc}
33
         */
34
        protected static function get_type_config(): array {
35
                $config = parent::get_type_config();
20✔
36

37
                $config['eagerlyLoadType'] = true;
20✔
38

39
                return $config;
20✔
40
        }
41

42
        /**
43
         * {@inheritDoc}
44
         */
45
        public static function get_description(): string {
UNCOV
46
                return __( 'The seo data for Post Objects', 'wp-graphql-rank-math' );
×
47
        }
48

49
        /**
50
         * {@inheritDoc}
51
         */
52
        public static function get_fields(): array {
53
                return [
20✔
54
                        'isPillarContent' => [
20✔
55
                                'type'        => 'Boolean',
20✔
56
                                'description' => static fn () => __( 'Whether the item is considered pillar (cornerstone) content', 'wp-graphql-rank-math' ),
20✔
57
                        ],
20✔
58
                        'seoScore'        => [
20✔
59
                                'type'        => SeoScore::get_type_name(),
20✔
60
                                'description' => static fn () => __( 'The SEO score', 'wp-graphql-rank-math' ),
20✔
61
                        ],
20✔
62
                ];
20✔
63
        }
64

65
        /**
66
         * {@inheritDoc}
67
         */
68
        public static function get_interfaces(): array {
69
                return [ Seo::get_type_name() ];
20✔
70
        }
71

72
        /**
73
         * {@inheritDoc}
74
         *
75
         * @param \WPGraphQL\Model\Model $value The model.
76
         */
77
        public static function get_resolved_type_name( $value ): ?string {
78
                $type_name = null;
×
79

80
                if ( isset( $value->post_type ) ) {
×
81
                        $type_name = 'RankMath' . graphql_format_type_name( $value->post_type . 'ObjectSeo' );
×
82
                }
83

84
                return $type_name;
×
85
        }
86
}
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

© 2025 Coveralls, Inc