-
Notifications
You must be signed in to change notification settings - Fork 162
Restrict multiple relationship fields with same type #3043
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
Restrict multiple relationship fields with same type #3043
Conversation
This test failed after validation was introduced. We do want this test so we update the types.
🦋 Changeset detectedLatest commit: d6a1cb6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Performance ReportNo Performance Changes Show Full Table
Old Schema Generation: 30.337s |
darrellwarde
left a comment
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 looks really good, a few comments! 🙂
packages/graphql/src/schema/validation/validate-schema-customizations.ts
Show resolved
Hide resolved
packages/graphql/tests/integration/config-options/startup-validation.int.test.ts
Outdated
Show resolved
Hide resolved
packages/graphql/src/schema/validation/validate-duplicate-relationship-fields.test.ts
Show resolved
Hide resolved
This allows us to remove two possible undefined cases, as we will only pass the defined schemaModel to wrapResolvers and wrapFederationResolvers.
Description
This PR introduces validation to detect cases where types have duplicate relationship fields.
A duplicate relationship field is when multiple relationship fields are defined on the same type with the same relationship type and the same direction.
Here's an example of duplicate relationship fields:
To allow disabling the checks for duplicate relationship fields, the
noDuplicateRelationshipFieldsconfig option has been added.Complexity
Medium