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

belongsTo/hasMany fetch by link with missing data key in returned payload should error. #7547

Closed
runspired opened this issue May 26, 2021 · 0 comments · Fixed by #7550
Closed
Labels
🏷️ feat This PR introduces a new feature

Comments

@runspired
Copy link
Contributor

runspired commented May 26, 2021

When an async belongsTo or hasMany relationship with no known data (not known empty and not known not-empty but has a link) is fetched via link, an error should be thrown if the returned payload does not have a data key (no error should be thrown if the returned payload has a data key but it specifies null for belongsTo or specifies [] for hasMany).

See #7534 for a recent adjustment to this codepath that would be the likely point at which to assert this.

It's possible we do error today, but I didn't see a test at first glance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ feat This PR introduces a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant