File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
example/src/main/kotlin/com/expedia/graphql/sample/query
src/main/kotlin/com/expedia/graphql/generator/extensions Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,11 @@ data class NestedNode(
13
13
val parentValue : Int? = null
14
14
) {
15
15
fun nested (environment : DataFetchingEnvironment , value : Int ): NestedNode {
16
- val parentValue: Int? = if (environment.executionStepInfo.hasParent()) environment.executionStepInfo.parent.getArgument(" value" ) else null
16
+ val parentValue: Int? = if (environment.executionStepInfo.hasParent()) {
17
+ environment.executionStepInfo.parent.getArgument(" value" )
18
+ } else {
19
+ null
20
+ }
17
21
18
22
return NestedNode (value, parentValue)
19
23
}
Original file line number Diff line number Diff line change @@ -5,13 +5,12 @@ import com.expedia.graphql.exceptions.CouldNotGetNameOfKParameterException
5
5
import graphql.schema.DataFetchingEnvironment
6
6
import kotlin.reflect.KParameter
7
7
import kotlin.reflect.full.findAnnotation
8
- import kotlin.reflect.full.isSuperclassOf
9
8
10
9
internal fun KParameter.isInterface () = this .type.getKClass().isInterface()
11
10
12
11
internal fun KParameter.isGraphQLContext () = this .findAnnotation<GraphQLContext >() != null
13
12
14
- internal fun KParameter.isDataFetchingEnvironment () = this .type.getKClass().isSuperclassOf( DataFetchingEnvironment ::class )
13
+ internal fun KParameter.isDataFetchingEnvironment () = this .type.classifier == DataFetchingEnvironment ::class
15
14
16
15
@Throws(CouldNotGetNameOfKParameterException ::class )
17
16
internal fun KParameter.getName (): String =
You can’t perform that action at this time.
0 commit comments