@@ -31,6 +31,35 @@ public void IntializeExplicitFieldWithImplicitResolver()
3131 Assert . NotNull ( fooType . Fields . First ( ) . Resolver ) ;
3232 }
3333
34+ [ Fact ]
35+ public void IntArgumentIsInferedAsNonNullType ( )
36+ {
37+ // arrange
38+ var errors = new List < SchemaError > ( ) ;
39+ var schemaContext = new SchemaContext ( ) ;
40+ var intType = new IntType ( ) ;
41+ schemaContext . Types . RegisterType ( intType ) ;
42+
43+ // act
44+ var fooType = new ObjectType < QueryWithIntArg > ( ) ;
45+
46+ // assert
47+ var initializationContext = new TypeInitializationContext (
48+ schemaContext , a => errors . Add ( a ) , fooType , false ) ;
49+ ( ( INeedsInitialization ) fooType )
50+ . RegisterDependencies ( initializationContext ) ;
51+ schemaContext . CompleteTypes ( ) ;
52+
53+ Assert . Empty ( errors ) ;
54+
55+ IType argumentType = fooType . Fields [ "bar" ]
56+ . Arguments . First ( ) . Type ;
57+
58+ Assert . NotNull ( argumentType ) ;
59+ Assert . True ( argumentType . IsNonNullType ( ) ) ;
60+ Assert . Equal ( intType , argumentType . NamedType ( ) ) ;
61+ }
62+
3463 [ Fact ]
3564 public void IntializeImpicitFieldWithImplicitResolver ( )
3665 {
@@ -478,6 +507,11 @@ public class FooResolver
478507 public string GetBar ( string foo ) => "hello foo" ;
479508 }
480509
510+ public class QueryWithIntArg
511+ {
512+ public string GetBar ( int foo ) => "hello foo" ;
513+ }
514+
481515 public class Bar
482516 {
483517 [ GraphQLNonNullType ]
0 commit comments