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

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

Closed
2 of 3 tasks
justlevine opened this issue Mar 23, 2024 · 1 comment · Fixed by #96
Closed
2 of 3 tasks
Labels
status: confirmed 📍 The issue has been confirmed and reproduced. type: enhancement ⚡ Improves on an existing feature

Comments

@justlevine
Copy link
Member

Description

Currently ${objectType}.seo is typed as RankMathSeo instead of RankMath${ObjectType}Seo.

This requires you to unnecessarily drill down the interface, like in 53efda5

We should leave the NodeWithSeo interface to use the RankMathSeo type, but for all direct connections we should resolve straight to the object. This would reduce complexity on both the query and implementation (i.e. graphql-Codegen) side of this.

Important

This may be a breaking change to implement.

Steps to reproduce

query UserSeo( $id: ID! ) {
user( id: $id, idType: DATABASE_ID ){
	databaseId
	seo {
		fullHead
		# this should not be necessary 👇
		... on RankMathUserSeo {
			additionalProfiles
			facebookProfileUrl
			twitterUserName
		}
	}
}

Additional context

No response

Plugin Version

0.1.0

WordPress Version

6.4.3

WPGraphQL Version

1.22.0

RankMath SEO Version

1.215.1

Additional enviornmental details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for RankMath SEO, WPGraphQL, and WPGraphQL for Rank Math

  • Yes
  • My issue is with a specific 3rd-party plugin.
@justlevine justlevine added status: confirmed 📍 The issue has been confirmed and reproduced. type: enhancement ⚡ Improves on an existing feature labels Mar 23, 2024
@justlevine
Copy link
Member Author

Ref: wp-graphql/wp-graphql#3096

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed 📍 The issue has been confirmed and reproduced. type: enhancement ⚡ Improves on an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant