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

Fix hidden field validation #664

Merged
merged 1 commit into from
Jan 7, 2025
Merged

Fix hidden field validation #664

merged 1 commit into from
Jan 7, 2025

Conversation

gnawf
Copy link
Collaborator

@gnawf gnawf commented Jan 6, 2025

Tried to bump Nadel in Central Schema and I found an edge case. It's legal for all fields to be @hidden if the type itself is going to be deleted because all references to it are from @hidden fields.

assertTrue(errors.isEmpty())
}

it("passes if all fields are hidden and their container type is deleted") {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New test here

type Query {
echo: String
}
""".trimIndent(),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reformat

@@ -33,7 +34,7 @@ class NadelFieldValidationTest : DescribeSpec({
)

val errors = validate(fixture)
assert(errors.map { it.message }.isEmpty())
assertTrue(errors.map { it.message }.isEmpty())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason if you run individual tests with kotlin.assert it doesn't fail.

Copy link

github-actions bot commented Jan 7, 2025

Test Results

  138 files  ±0  138 suites  ±0   1m 1s ⏱️ +5s
1 029 tests +1  962 ✅ +1  67 💤 ±0  0 ❌ ±0 
1 037 runs  +1  970 ✅ +1  67 💤 ±0  0 ❌ ±0 

Results for commit d4ab998. ± Comparison against base commit 38ac346.

@gnawf gnawf merged commit 232aab9 into master Jan 7, 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.

3 participants