-
Notifications
You must be signed in to change notification settings - Fork 24
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
Prevent multiple source fields even if list is not leaf field #503
Conversation
@@ -170,6 +170,97 @@ class NadelHydrationValidationTest2 { | |||
assertTrue(errors.single().subject.name == "data") | |||
} | |||
|
|||
@Test | |||
fun `prohibit multiple source fields where list not the leaf`() { |
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 should actually be an allowed feature, but it's not supported right now.
e1d70e0
to
abc7594
Compare
parentType.getFieldAt(path)?.type?.unwrapNonNull()?.isList == true | ||
.mapNotNull { it.remoteArgumentSource.pathToField } | ||
} | ||
.toList() |
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.
Pulled the paths out to a list
parentType | ||
.getFieldsAlong(pathToField) | ||
.any { field -> | ||
field.type.unwrapNonNull().isList |
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 the actual change.
e.g. for $source.contexts.userId
where contexts
is a list but userId
is not a list
Previously we only checked the end field to see if it was a list, this checks everything.
No description provided.