AxeWP / wp-graphql-rank-math

Add GraphQL support for RankMath SEO
GNU General Public License v3.0
51 stars 7 forks source link

feat!: refactor `seo` to use GraphQL Interfaces #24

Closed justlevine closed 1 year ago

justlevine commented 1 year ago

What

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

How

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: