This PR refactors how SEO data is added to the schema. In particular the seo field is now of type RankMathSeo and is added using the NodeWithRankMathSeo interface.
Why
DRYer and indeterminate queries (e.g. with nodeByUri() ).
Lays the foundation for Object-specific SEO fields.
How
feat!: Rename RankMathBaseSeoFields interface to `RankMathSeo.
feat!: Change seo field type to RankMathoSeo interface and impelement with NodeWithRankMathSeo interface.
feat!: Change RankMathCommentNodeSeo from GraphQL object to interface.
dev: add the following WordPress filters: graphql_seo_model_class, graphql_seo_resolved_type_name, graphql_seo_types_with_seo.
Testing Instructions
query MyNodeByUriQuery( $uri: String ) {
nodeByUri( uri: $uri ) {
... on NodeWithRankMathSeo {
seo {
breadcrumbs {
title
url
isHidden
}
breadcrumbTitle
canonicalUrl
description
focusKeywords
fullHead
jsonLd {
raw
}
robots
title
... on RankMathContentNodeSeo {
isPillarContent
seoScore {
score
}
}
}
}
}
}
Additional Info
Checklist:
[x] My code is tested to the best of my abilities.
[x] My code follows the WordPress Coding Standards.
[x] My code has proper inline documentation.
[x] I have added unit tests to verify the code works as intended.
[x] The changes in this PR have been noted in CHANGELOG.md
What
This PR refactors how SEO data is added to the schema. In particular the
seo
field is now of typeRankMathSeo
and is added using theNodeWithRankMathSeo
interface.Why
nodeByUri()
).How
RankMathBaseSeoFields
interface to `RankMathSeo.seo
field type toRankMathoSeo
interface and impelement withNodeWithRankMathSeo
interface.RankMathCommentNodeSeo
from GraphQL object to interface.graphql_seo_model_class
,graphql_seo_resolved_type_name
,graphql_seo_types_with_seo
.Testing Instructions
Additional Info
Checklist: