AxeWP / wp-graphql-rank-math

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

feat!: Narrow `seo` field types to their implementations. #96

Closed justlevine closed 4 months ago

justlevine commented 4 months ago

What

This PR improves the GraphQL schema by narrowing the NodeWithSeo.seo field type down to the implementation type (e.g. RankMathContentNodeSeo, RankMathPostSeo RankMathUserSeo etc.

That means instead of wrapping our queries with ...on *SEO { }, we can access the fields directly on the schema.

Why

Closes #79

How

Introduced a new Utils::overload_graphql_field_type() to get around https://github.com/wp-graphql/wp-graphql/issues/3096

Testing Instructions

Additional Info

Checklist: