Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

MTKA-1542: Ensure relationship fields resolve if model slug mismatches singular label #566

Merged
merged 3 commits into from
Jun 15, 2022

Conversation

nickcernis
Copy link
Member

@nickcernis nickcernis commented Jun 10, 2022

Description

Bug fix for #552 so that relationship fields no longer resolve as null if the model slug does not match the singular label.

https://wpengine.atlassian.net/browse/MTKA-1542

Checklist

I have:

  • Added an entry to CHANGELOG.md.

Testing

Includes unit test for a GraphQL query with a relationship field on a model with a mismatched singular name and slug.

To test manually, import this blueprint with pre-made relationship fields and connected entries:

wp acm blueprint import http://contentmodel1.wpengine.com/wp-content/uploads/2022/06/relationships.zip

Then make GraphQL queries against the modela, modelb, modelc and mismatch post types. You should see data for the relationship fields instead of 'null'.

Screenshots

Before After
before after

@nickcernis nickcernis marked this pull request as ready for review June 13, 2022 14:24
@nickcernis nickcernis requested a review from a team as a code owner June 13, 2022 14:24
Copy link
Member

@anthonyburchell anthonyburchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and worked in my manual testing. :D

Thanks for the blueprint for testing too!

@nickcernis nickcernis merged commit 966468c into main Jun 15, 2022
@nickcernis nickcernis deleted the mtka-1542/null-relationships branch June 15, 2022 08:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants