-
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
Default hydration validation #668
Conversation
d272e0f
to
aea8498
Compare
@@ -11,14 +12,14 @@ fun GraphQLNamedType.hasDefaultHydration(): Boolean { | |||
return (this as? GraphQLDirectiveContainer)?.hasAppliedDirective(Keyword.defaultHydration) == true | |||
} | |||
|
|||
fun GraphQLNamedType.getDefaultHydrationOrNull(): NadelDefaultHydrationDefinition? { | |||
fun GraphQLNamedType.parseDefaultHydrationOrNull(): NadelDefaultHydrationDefinition? { |
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.
Fix naming
} | ||
|
||
type.parseRenamedOrNull()?.also(definitions::add) | ||
type.parseDefaultHydrationOrNull()?.also(definitions::add) |
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.
Adds default hydration definition here
namespaceValidation = namespaceValidation, | ||
virtualTypeValidation = virtualTypeValidation, | ||
) | ||
|
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.
why is this missing ?
namespaceValidation = namespaceValidation, | ||
virtualTypeValidation = virtualTypeValidation, | ||
defaultHydrationDefinitionValidation = defaultHydrationDefinitionValidation, | ||
), |
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.
ahh moved here
type Issue { | ||
id: ID! | ||
} | ||
""".trimIndent(), |
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.
graphql cares nothing for your trimIndent()
Pending #644
This validation focuses on the
@defaultHydration
itself.Previously you could define invalid ones, and it would still be caught when hydration validation ran. This change adds an earlier layer of validation when you define it before a
@idHydrated
consumes it.