Skip to content
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

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Default hydration validation #668

merged 1 commit into from
Jan 21, 2025

Conversation

gnawf
Copy link
Collaborator

@gnawf gnawf commented Jan 20, 2025

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.

Copy link

github-actions bot commented Jan 20, 2025

Test Results

  560 files  +1    560 suites  +1   1m 0s ⏱️ +3s
1 873 tests +5  1 388 ✅ +5  485 💤 ±0  0 ❌ ±0 
1 881 runs  +5  1 396 ✅ +5  485 💤 ±0  0 ❌ ±0 

Results for commit aea8498. ± Comparison against base commit 602de38.

♻️ This comment has been updated with latest results.

@gnawf gnawf force-pushed the default-hydration-validation branch from d272e0f to aea8498 Compare January 20, 2025 23:56
@@ -11,14 +12,14 @@ fun GraphQLNamedType.hasDefaultHydration(): Boolean {
return (this as? GraphQLDirectiveContainer)?.hasAppliedDirective(Keyword.defaultHydration) == true
}

fun GraphQLNamedType.getDefaultHydrationOrNull(): NadelDefaultHydrationDefinition? {
fun GraphQLNamedType.parseDefaultHydrationOrNull(): NadelDefaultHydrationDefinition? {
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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

@gnawf gnawf marked this pull request as ready for review January 21, 2025 00:07
namespaceValidation = namespaceValidation,
virtualTypeValidation = virtualTypeValidation,
)

Copy link
Collaborator

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,
),
Copy link
Collaborator

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(),
Copy link
Collaborator

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()

@gnawf gnawf merged commit efee18f into master Jan 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants