@@ -3,6 +3,7 @@ package com.expedia.graphql.generator.types
3
3
import com.expedia.graphql.annotations.GraphQLContext
4
4
import com.expedia.graphql.annotations.GraphQLDescription
5
5
import com.expedia.graphql.annotations.GraphQLDirective
6
+ import com.expedia.graphql.annotations.GraphQLIgnore
6
7
import com.expedia.graphql.execution.FunctionDataFetcher
7
8
import graphql.Scalars
8
9
import graphql.introspection.Introspection
@@ -52,6 +53,8 @@ internal class FunctionBuilderTest : TypeTestHelper() {
52
53
53
54
fun context (@GraphQLContext context : String , string : String ) = " $context and $string "
54
55
56
+ fun ignoredParameter (color : String , @GraphQLIgnore ignoreMe : String ) = " $color and $ignoreMe "
57
+
55
58
fun completableFuture (num : Int ): CompletableFuture <Int > = CompletableFuture .completedFuture(num)
56
59
57
60
fun dataFetchingEnvironment (environment : DataFetchingEnvironment ): String = environment.field.name
@@ -128,6 +131,17 @@ internal class FunctionBuilderTest : TypeTestHelper() {
128
131
assertEquals(expected = " string" , actual = arg?.name)
129
132
}
130
133
134
+ @Test
135
+ fun `Test ignored parameter` () {
136
+ val kFunction = Happy ::ignoredParameter
137
+ val result = builder.function(kFunction)
138
+
139
+ assertTrue(result.directives.isEmpty())
140
+ assertEquals(expected = 1 , actual = result.arguments.size)
141
+ val arg = result.arguments.firstOrNull()
142
+ assertEquals(expected = " color" , actual = arg?.name)
143
+ }
144
+
131
145
@Test
132
146
fun `Non-abstract function` () {
133
147
val kFunction = MyInterface ::printMessage
0 commit comments