-
Notifications
You must be signed in to change notification settings - Fork 70
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
fix: fix reference-style relationship validation #2533
Conversation
if (!associatedRelationalDirective) { | ||
throw new InvalidDirectiveError(`Uni-directional relationships are not supported. ${expectedBidirectionalErrorMessages()}`); | ||
return []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is safe to do because we have validation elsewhere for empty associated fields. This check was causing an early return in recursive schemas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me. Do we have E2E tests with references style to make sure the runtime behavior works as expected for multiple and recursive relationships between types.
Update: Nvm, I missed your note on the E2E tests.
Description of changes
This change fixes relationship validation for reference-style relationships to support two use cases:
1. Fixes support for multiple relationships between models.
Example:
2. Fixes support for recursive relationships
Example:
Additional changes
NOTE: New E2Es covering these cases will come in a followup PR
Checklist
yarn test
passesrds_pg_userpool_auth
passed except for yarn lockBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.