Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
May 11, 2024

Conversation

justlevine
Copy link
Member

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 wp-graphql/wp-graphql#3096

Testing Instructions

Additional Info

Checklist:

  • My code is tested to the best of my abilities.
  • My code follows the WordPress Coding Standards.
  • My code has proper inline documentation.
  • I have added unit tests to verify the code works as intended.
  • The changes in this PR have been noted in CHANGELOG.md

@justlevine justlevine merged commit a662dbd into AxeWP:develop May 11, 2024
22 of 25 checks passed
@justlevine justlevine deleted the feat/narrow-interface-types branch May 11, 2024 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

seo fields should resolve directly to the GraphQL object (instead of the interface) when possible.
1 participant