@@ -13,61 +13,61 @@ class MissingFieldResolverTest {
1313 @Test(expected = FieldResolverError ::class )
1414 fun `should throw error` () {
1515 SchemaParser .newParser()
16- .schemaString("""
16+ .schemaString("""
1717 type Query {
1818 implementedField(input: String): String
1919 missingField(input: Int): Int
2020 }
2121 """
22- )
23- .resolvers(object : GraphQLQueryResolver {
24- fun implementedField (input : Optional <String >) = input.toString()
25- })
26- .build()
27- .makeExecutableSchema()
22+ )
23+ .resolvers(object : GraphQLQueryResolver {
24+ fun implementedField (input : Optional <String >) = input.toString()
25+ })
26+ .build()
27+ .makeExecutableSchema()
2828 }
2929
3030 @Test
3131 fun `should call missing field resolver handler if provided` () {
3232 val schema = SchemaParser .newParser()
33- .schemaString("""
33+ .schemaString("""
3434 type Query {
3535 implementedField(input: String): String
3636 missingField(input: Int): Int
3737 }
3838 """
39- )
40- .resolvers(object : GraphQLQueryResolver {
41- fun implementedField (input : Optional <String >) = input.toString()
42- })
43- .options(SchemaParserOptions .newOptions()
44- .missingFieldResolverHandler(TestMissingFieldResolverHandler ())
45- .build())
46- .build()
47- .makeExecutableSchema()
39+ )
40+ .resolvers(object : GraphQLQueryResolver {
41+ fun implementedField (input : Optional <String >) = input.toString()
42+ })
43+ .options(SchemaParserOptions .newOptions()
44+ .missingFieldResolverHandler(TestMissingFieldResolverHandler ())
45+ .build())
46+ .build()
47+ .makeExecutableSchema()
4848
4949 val gql = GraphQL .newGraphQL(schema).build()
5050
5151 val result = gql
52- .execute(ExecutionInput .newExecutionInput()
53- .query("""
52+ .execute(ExecutionInput .newExecutionInput()
53+ .query("""
5454 query {
5555 implementedField(input: "test-value")
5656 missingField(input: 1)
5757 }
5858 """ )
59- .context(Object ())
60- .root(Object ()))
59+ .context(Object ())
60+ .root(Object ()))
6161
6262 val expected = mapOf (
63- " implementedField" to " Optional[test-value]" ,
64- " missingField" to 1
63+ " implementedField" to " Optional[test-value]" ,
64+ " missingField" to 1
6565 )
6666
6767 Assert .assertEquals(expected, result.getData())
6868 }
6969
70- class TestMissingFieldResolverHandler : MissingFieldResolverHandler {
70+ class TestMissingFieldResolverHandler : MissingFieldResolverHandler {
7171 override fun resolve (env : DataFetchingEnvironment ? ): Any? {
7272 return env?.getArgument(" input" );
7373 }
0 commit comments