Skip to content

Commit 99dc9c2

Browse files
committed
Removed unused directive wirings and upgraded dependencies
1 parent e6f6f4d commit 99dc9c2

File tree

3 files changed

+8
-36
lines changed

3 files changed

+8
-36
lines changed

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<kotlin.version>1.3.31</kotlin.version>
1919
<kotlin-coroutines.version>1.2.1</kotlin-coroutines.version>
2020
<jackson.version>2.9.9</jackson.version>
21+
<graphql-java.version>13.0</graphql-java.version>
2122

2223
<maven.compiler.source>${java.version}</maven.compiler.source>
2324
<maven.compiler.target>${java.version}</maven.compiler.target>
@@ -49,12 +50,12 @@
4950
<dependency>
5051
<groupId>com.graphql-java</groupId>
5152
<artifactId>graphql-java</artifactId>
52-
<version>13.0</version>
53+
<version>${graphql-java.version}</version>
5354
</dependency>
5455
<dependency>
5556
<groupId>com.fasterxml</groupId>
5657
<artifactId>classmate</artifactId>
57-
<version>1.4.0</version>
58+
<version>1.5.0</version>
5859
</dependency>
5960
<dependency>
6061
<groupId>com.fasterxml.jackson.core</groupId>
@@ -74,7 +75,7 @@
7475
<dependency>
7576
<groupId>com.esotericsoftware</groupId>
7677
<artifactId>reflectasm</artifactId>
77-
<version>1.11.7</version>
78+
<version>1.11.9</version>
7879
</dependency>
7980
<dependency>
8081
<groupId>org.apache.commons</groupId>
@@ -142,7 +143,6 @@
142143

143144
<build>
144145
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
145-
<!-- <testSourceDirectory>${project.basedir}/src/test/groovy</testSourceDirectory>-->
146146
<plugins>
147147
<plugin>
148148
<groupId>org.codehaus.mojo</groupId>

src/main/kotlin/com/coxautodev/graphql/tools/SchemaParser.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ class SchemaParser internal constructor(scanResult: ScannedSchemaObjects, privat
163163
?: throw SchemaError("No resolver method found for object type '${objectDefinition.name}' and field '${fieldDefinition.name}', this is most likely a bug with graphql-java-tools")
164164
)
165165

166-
val wiredField = directiveGenerator.onField(field.build(), DirectiveBehavior.Params(runtimeWiring))
166+
val wiredField = field.build()
167167
GraphQLFieldDefinition.Builder(wiredField)
168168
.clearArguments()
169169
.arguments(wiredField.arguments)
@@ -204,7 +204,7 @@ class SchemaParser internal constructor(scanResult: ScannedSchemaObjects, privat
204204
.defaultValue(inputDefinition.defaultValue)
205205
.type(determineInputType(inputDefinition.type))
206206
.withDirectives(*buildDirectives(definition.directives, setOf(), Introspection.DirectiveLocation.INPUT_FIELD_DEFINITION))
207-
builder.field(directiveGenerator.onInputObjectField(fieldBuilder.build(), DirectiveBehavior.Params(runtimeWiring)))
207+
builder.field(fieldBuilder.build())
208208
}
209209

210210
return directiveGenerator.onInputObject(builder.build(), DirectiveBehavior.Params(runtimeWiring))
@@ -237,7 +237,7 @@ class SchemaParser internal constructor(scanResult: ScannedSchemaObjects, privat
237237
.definition(enumDefinition)
238238
.build()
239239

240-
builder.value(directiveGenerator.onEnumValue(enumValueDefinition, DirectiveBehavior.Params(runtimeWiring)))
240+
builder.value(enumValueDefinition)
241241
}
242242
}
243243

@@ -307,7 +307,7 @@ class SchemaParser internal constructor(scanResult: ScannedSchemaObjects, privat
307307
.defaultValue(buildDefaultValue(argumentDefinition.defaultValue))
308308
.type(determineInputType(argumentDefinition.type))
309309
.withDirectives(*buildDirectives(argumentDefinition.directives, setOf(), Introspection.DirectiveLocation.ARGUMENT_DEFINITION))
310-
field.argument(directiveGenerator.onArgument(argumentBuilder.build(), DirectiveBehavior.Params(runtimeWiring)))
310+
field.argument(argumentBuilder.build())
311311
}
312312
field.withDirectives(*buildDirectives(fieldDefinition.directives, setOf(), Introspection.DirectiveLocation.FIELD_DEFINITION))
313313
return field

src/main/kotlin/graphql/schema/idl/DirectiveBehavior.kt

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
package graphql.schema.idl
22

3-
import graphql.schema.GraphQLArgument
43
import graphql.schema.GraphQLEnumType
5-
import graphql.schema.GraphQLEnumValueDefinition
6-
import graphql.schema.GraphQLFieldDefinition
7-
import graphql.schema.GraphQLInputObjectField
84
import graphql.schema.GraphQLInputObjectType
95
import graphql.schema.GraphQLInterfaceType
106
import graphql.schema.GraphQLObjectType
@@ -19,12 +15,6 @@ class DirectiveBehavior {
1915
return directiveHelper.onObject(element, params.toParameters())
2016
}
2117

22-
@Suppress("UNUSED_PARAMETER")
23-
fun onField(element: GraphQLFieldDefinition, params: Params): GraphQLFieldDefinition {
24-
// noop, since the actual behaviour has moved to onObject/onInterface since graphql-java 12.0
25-
return element
26-
}
27-
2818
fun onInterface(element: GraphQLInterfaceType, params: Params): GraphQLInterfaceType =
2919
directiveHelper.onInterface(element, params.toParameters())
3020

@@ -37,27 +27,9 @@ class DirectiveBehavior {
3727
fun onEnum(element: GraphQLEnumType, params: Params): GraphQLEnumType =
3828
directiveHelper.onEnum(element, params.toParameters())
3929

40-
@Suppress("UNUSED_PARAMETER")
41-
fun onEnumValue(element: GraphQLEnumValueDefinition, params: Params): GraphQLEnumValueDefinition {
42-
// noop, since the actual behaviour has moved to onEnum since graphql-java 12.0
43-
return element
44-
}
45-
46-
@Suppress("UNUSED_PARAMETER")
47-
fun onArgument(element: GraphQLArgument, params: Params): GraphQLArgument {
48-
// noop, since the actual behaviour has moved to onObject/onInterface since graphql-java 12.0
49-
return element
50-
}
51-
5230
fun onInputObject(element: GraphQLInputObjectType, params: Params): GraphQLInputObjectType =
5331
directiveHelper.onInputObjectType(element, params.toParameters())
5432

55-
@Suppress("UNUSED_PARAMETER")
56-
fun onInputObjectField(element: GraphQLInputObjectField, params: Params): GraphQLInputObjectField {
57-
// noop, since the actual behaviour has moved to onInputObjectType since graphql-java 12.0
58-
return element
59-
}
60-
6133
data class Params(val runtimeWiring: RuntimeWiring) {
6234
internal fun toParameters() = SchemaGeneratorDirectiveHelper.Parameters(null, runtimeWiring, null, null)
6335
}

0 commit comments

Comments
 (0)