• 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

94.44
/src/Type/WPObject/Settings/Sitemap/ContentType.php
1
<?php
2
/**
3
 * The ContentType sitemap GraphQL object.
4
 *
5
 * @package WPGraphQL\RankMath\Type\WPObject\Settings\Sitemap
6
 */
7

8
declare( strict_types = 1 );
9

10
namespace WPGraphQL\RankMath\Type\WPObject\Settings\Sitemap;
11

12
use RankMath\Helper;
13
use WPGraphQL\Data\Connection\PostObjectConnectionResolver;
14
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Abstracts\ObjectType;
15
use WPGraphQL\RankMath\Vendor\AxeWP\GraphQL\Interfaces\TypeWithConnections;
16

17
/**
18
 * Class - ContentType
19
 */
20
class ContentType extends ObjectType implements TypeWithConnections {
21
        /**
22
         * {@inheritDoc}
23
         */
24
        protected static function type_name(): string {
25
                return 'SitemapContentTypeSettings';
20✔
26
        }
27

28
        /**
29
         * {@inheritDoc}
30
         */
31
        public static function get_connections(): array {
32
                return [
20✔
33
                        'connectedContentNodes' => [
20✔
34
                                'toType'      => 'ContentNode',
20✔
35
                                'description' => static fn () => __( 'The connected content nodes whose URLs are included in the sitemap', 'wp-graphql-rank-math' ),
20✔
36
                                'resolve'     => static function ( $source, $args, $context, $info ) {
20✔
37
                                        if ( empty( $source['isInSitemap'] ) ) {
1✔
38
                                                return null;
1✔
39
                                        }
40

41
                                        $resolver = new PostObjectConnectionResolver( $source, $args, $context, $info, $source['type'] );
1✔
42

43
                                        $excluded_post_ids = Helper::get_settings( 'sitemap.exclude_posts' );
1✔
44
                                        $excluded_post_ids = ! empty( $excluded_post_ids ) ? array_map( 'absint', explode( ',', $excluded_post_ids ) ) : null;
1✔
45

46
                                        if ( ! empty( $excluded_post_ids ) ) {
1✔
47
                                                $resolver->set_query_arg( 'post__not_in', $excluded_post_ids );
×
48
                                        }
49

50
                                        return $resolver->get_connection();
1✔
51
                                },
20✔
52
                        ],
20✔
53
                ];
20✔
54
        }
55

56
        /**
57
         * {@inheritDoc}
58
         */
59
        public static function get_description(): string {
UNCOV
60
                return __( 'The RankMath SEO Sitemap general settings.', 'wp-graphql-rank-math' );
×
61
        }
62

63
        /**
64
         * {@inheritDoc}
65
         */
66
        public static function get_fields(): array {
67
                return [
20✔
68
                        'customImageMetaKeys' => [
20✔
69
                                'type'        => [ 'list_of' => 'String' ],
20✔
70
                                'description' => static fn () => __( 'List of custom field (post meta) names which contain image URLs to include them in the sitemaps.', 'wp-graphql-rank-math' ),
20✔
71
                        ],
20✔
72
                        'isInSitemap'         => [
20✔
73
                                'type'        => 'Boolean',
20✔
74
                                'description' => static fn () => __( 'Whether the content type is included in the sitemap.', 'wp-graphql-rank-math' ),
20✔
75
                        ],
20✔
76
                        'sitemapUrl'          => [
20✔
77
                                'type'        => 'String',
20✔
78
                                'description' => static fn () => __( 'The sitemap URL.', 'wp-graphql-rank-math' ),
20✔
79
                        ],
20✔
80
                        'type'                => [
20✔
81
                                'type'        => 'ContentTypeEnum',
20✔
82
                                'description' => static fn () => __( 'The content type.', 'wp-graphql-rank-math' ),
20✔
83
                        ],
20✔
84

85
                ];
20✔
86
        }
87
}
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