Skip to content

Commit 7996ab1

Browse files
authored
check is always failing, might as well make it an error (#5153)
1 parent fb6245f commit 7996ab1

File tree

2 files changed

+2
-5
lines changed
  • libraries/apollo-ast/src
    • commonMain/kotlin/com/apollographql/apollo3/ast
    • commonTest/kotlin/com/apollographql/apollo3/graphql/ast/test

2 files changed

+2
-5
lines changed

libraries/apollo-ast/src/commonMain/kotlin/com/apollographql/apollo3/ast/gqltype.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,11 @@ private fun GQLType.withItemNullability(itemNullability: GQLNullability?, valida
9292
if (this !is GQLListType) {
9393
when (validation) {
9494
is NullabilityValidationThrow -> {
95-
check(this is GQLListType) {
96-
"Cannot apply nullability, the nullability list dimension exceeds the one of the field type."
97-
}
95+
error("Cannot apply nullability, the nullability list dimension exceeds the one of the field type.")
9896
}
9997

10098
is NullabilityValidationIgnore -> {
10199
return this
102-
103100
}
104101

105102
is NullabilityValidationRegister -> {

libraries/apollo-ast/src/commonTest/kotlin/com/apollographql/apollo3/graphql/ast/test/GQLTest.kt renamed to libraries/apollo-ast/src/commonTest/kotlin/com/apollographql/apollo3/graphql/ast/test/CcnTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.apollographql.apollo3.ast.withNullability
99
import kotlin.test.Test
1010
import kotlin.test.assertEquals
1111

12-
class GQLTest {
12+
class CcnTest {
1313
@Test
1414
fun type() {
1515
val newType = "[String!]!".parseAsGQLType().getOrThrow().withNullability(GQLListNullability(selfNullability = null, itemNullability = GQLNullDesignator()))

0 commit comments

Comments
 (0)