diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 7ceaf9fe..85149530 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -24,23 +24,3 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Build with Maven run: mvn --batch-mode --update-snapshots verify - - # The same jar has to work with the oldest supported graphql-java, so build and test against it too - graphql-java-25: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v7 - - name: Setup java - uses: actions/setup-java@v6 - with: - java-version: '11' - distribution: 'temurin' - - name: Cache Maven packages - uses: actions/cache@v6 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build with Maven - run: mvn --batch-mode --update-snapshots verify -Dgraphql-java.version=25.1 diff --git a/src/main/kotlin/graphql/kickstart/tools/SdlDirectives.kt b/src/main/kotlin/graphql/kickstart/tools/SdlDirectives.kt index 6f0f6d7f..7a469012 100644 --- a/src/main/kotlin/graphql/kickstart/tools/SdlDirectives.kt +++ b/src/main/kotlin/graphql/kickstart/tools/SdlDirectives.kt @@ -39,7 +39,7 @@ internal class SdlDirectives( } private fun isNonRepeatableByFirstDeclaration(directiveName: String): Boolean = - directiveDefinitions.find { it.name == directiveName }?.let { !it.isRepeatable } ?: BUILT_IN_DIRECTIVES.containsKey(directiveName) + directiveDefinitions.find { it.name == directiveName }?.let { !it.isRepeatable } ?: Directives.BUILT_IN_DIRECTIVES_MAP.containsKey(directiveName) private fun createDirectives() { schemaDirectives = directiveDefinitions.associateTo(linkedMapOf()) { it.name to createDirective(it) } @@ -143,7 +143,7 @@ internal class SdlDirectives( } } - private fun findDirective(name: String): GraphQLDirective? = schemaDirectives[name] ?: BUILT_IN_DIRECTIVES[name] + private fun findDirective(name: String): GraphQLDirective? = schemaDirectives[name] ?: Directives.BUILT_IN_DIRECTIVES_MAP[name] // there's no directive definition to look the type up in, so it's guessed from the value private fun guessDirectiveArgumentType(directive: Directive, argumentName: String, value: Value<*>): GraphQLInputType { @@ -239,14 +239,3 @@ internal class SdlDirectives( } } -// Built from the individual constants rather than Directives.BUILT_IN_DIRECTIVES_MAP (added in graphql-java 26) -// so that the library keeps working with graphql-java 25. TODO replace with Directives.BUILT_IN_DIRECTIVES_MAP once we deploy a major version -private val BUILT_IN_DIRECTIVES = listOf( - Directives.IncludeDirective, - Directives.SkipDirective, - Directives.DeprecatedDirective, - Directives.SpecifiedByDirective, - Directives.OneOfDirective, - Directives.DeferDirective, - Directives.ExperimentalDisableErrorPropagationDirective -).associateBy { it.name } diff --git a/src/test/kotlin/graphql/kickstart/tools/TypeExtensionTest.kt b/src/test/kotlin/graphql/kickstart/tools/TypeExtensionTest.kt index c6c6acb2..680835aa 100644 --- a/src/test/kotlin/graphql/kickstart/tools/TypeExtensionTest.kt +++ b/src/test/kotlin/graphql/kickstart/tools/TypeExtensionTest.kt @@ -71,8 +71,8 @@ class TypeExtensionTest { assertEquals(date.description, "A date") assertEquals(date.appliedDirectives.map { it.name }, listOf("format")) - // through GraphQLNamedSchemaElement, since graphql-java 25 and 26 disagree on which types have a nullable definition - assertEquals(listOf(fooBar, color, node, item, date).map { it.definition?.javaClass }, listOf( + val definitions = listOf(fooBar.definition, color.definition, node.definition, item.definition, date.definition) + assertEquals(definitions.map { it?.javaClass }, listOf( UnionTypeDefinition::class.java, EnumTypeDefinition::class.java, InterfaceTypeDefinition::class.java,