-
Notifications
You must be signed in to change notification settings - Fork 23
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
Partition validation #598
base: master
Are you sure you want to change the base?
Partition validation #598
Conversation
.filter { NamespacedUtil.isNamespacedField(it) } | ||
.map { it.type } | ||
.filterIsInstance<GraphQLNamedOutputType>() | ||
.filter {it.name == type.name} |
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.
Nit
.filter {it.name == type.name} | |
.filter { it.name == type.name } |
.asSequence() | ||
.flatMap { it.fieldDefinitions } | ||
.filter { NamespacedUtil.isNamespacedField(it) } | ||
.map { it.type } |
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.
Unlikely to be needed, but perhaps you should call .unwrapAll
to be safer.
conditionSupplier: () -> Boolean, | ||
): List<NadelSchemaValidationError> { | ||
return if (conditionSupplier()) { | ||
listOf(error) |
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.
You could also make this a supplier and mark the function as inline
for effectively zero cost lambda
Add validation rules for the usage of the
@partition
directive