From b84bb1a4b4f17f9ad8ec87ebde6f198c62f67f5a Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Sun, 5 Nov 2023 13:47:03 -0800 Subject: [PATCH] Fix issue where java datafetcher methods were incorrectly called as Kotlin functions (#1694) Co-authored-by: pbakker --- .../com/netflix/graphql/dgs/internal/DataFetcherInvoker.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/DataFetcherInvoker.kt b/graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/DataFetcherInvoker.kt index 693b38433..f1673ebf6 100644 --- a/graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/DataFetcherInvoker.kt +++ b/graphql-dgs/src/main/kotlin/com/netflix/graphql/dgs/internal/DataFetcherInvoker.kt @@ -65,7 +65,7 @@ class DataFetcherInvoker internal constructor( return ReflectionUtils.invokeMethod(bridgedMethod, dgsComponent) } - if (kotlinFunction != null) { + if (dgsComponent.javaClass.getDeclaredAnnotation(Metadata::class.java) != null && kotlinFunction != null) { return invokeKotlinMethod(kotlinFunction, environment) }