Skip to content

Commit

Permalink
Add a test for graphql/graphql-spec#1106 (#6062)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbonnin authored Jul 19, 2024
1 parent b0e5e08 commit c36df17
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions libraries/apollo-ast/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ kotlin {
getByName("jvmTest") {
dependencies {
implementation(libs.google.testparameterinjector)
implementation(libs.kotlin.test)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.apollographql.apollo.ast.parseAsGQLDocument
import com.apollographql.apollo.ast.parseAsGQLValue
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFails
import kotlin.test.fail

class CommonParserTest {
Expand Down Expand Up @@ -111,4 +112,19 @@ query Test {
assertEquals(3, column)
}
}

/**
* https://github.com/graphql/graphql-spec/issues/1106
*/
@Test
fun extendTypeMustAddDirectiveFieldOrInterface() {
assertFails {
"""
extend type Query
""".trimIndent()
.parseAsGQLDocument()
.getOrThrow()

}
}
}

0 comments on commit c36df17

Please sign in to comment.