Skip to content

Commit e9074ec

Browse files
committed
Make nullable
1 parent e5ca52b commit e9074ec

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/main/kotlin/graphql/kickstart/tools/resolver/MethodFieldResolver.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ internal class LightMethodFieldResolverDataFetcher(
227227
private val options: SchemaParserOptions
228228
) : LightDataFetcher<Any?> {
229229

230-
override fun get(fieldDefinition: GraphQLFieldDefinition, sourceObject: Any?, environmentSupplier: Supplier<DataFetchingEnvironment>): Any? {
230+
override fun get(fieldDefinition: GraphQLFieldDefinition?, sourceObject: Any?, environmentSupplier: Supplier<DataFetchingEnvironment>): Any? {
231231
val source = sourceResolver.resolve(null, sourceObject)
232232

233233
return invoke(method, source, emptyArray())?.transformWithGenericWrapper(options.genericWrappers, environmentSupplier)

src/test/kotlin/graphql/kickstart/tools/MethodFieldResolverDataFetcherTest.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import graphql.language.TypeName
1313
import graphql.schema.DataFetcher
1414
import graphql.schema.DataFetchingEnvironment
1515
import graphql.schema.DataFetchingEnvironmentImpl
16-
import graphql.schema.GraphQLFieldDefinition
17-
import graphql.schema.GraphQLObjectType
1816
import kotlinx.coroutines.Dispatchers
1917
import kotlinx.coroutines.ExperimentalCoroutinesApi
2018
import kotlinx.coroutines.Job
@@ -301,12 +299,6 @@ class MethodFieldResolverDataFetcherTest {
301299
private fun createEnvironment(source: Any = Object(), arguments: Map<String, Any> = emptyMap(), context: GraphQLContext? = null): DataFetchingEnvironment {
302300
return DataFetchingEnvironmentImpl.newDataFetchingEnvironment(buildExecutionContext())
303301
.source(source)
304-
.fieldDefinition(
305-
GraphQLFieldDefinition.newFieldDefinition()
306-
.name("ignored")
307-
.type(GraphQLObjectType.newObject().name("ignored").build())
308-
.build()
309-
)
310302
.arguments(arguments)
311303
.graphQLContext(context)
312304
.build()

0 commit comments

Comments
 (0)