2121import org .osgi .service .component .annotations .Component ;
2222import org .osgi .service .component .annotations .Reference ;
2323
24- import javax .validation .constraints .NotNull ;
2524import java .lang .reflect .*;
2625import java .util .*;
2726import java .util .function .Function ;
@@ -471,7 +470,6 @@ protected GraphQLFieldDefinition getField(Field field) throws GraphQLAnnotations
471470 }
472471
473472 GraphQLOutputType outputType = (GraphQLOutputType ) typeFunction .buildType (field .getType (), field .getAnnotatedType ());
474- outputType = field .isAnnotationPresent (NotNull .class ) ? new GraphQLNonNull (outputType ) : outputType ;
475473
476474 boolean isConnection = isConnection (field , outputType );
477475 if (isConnection ) {
@@ -629,7 +627,6 @@ protected GraphQLFieldDefinition getField(Method method) throws GraphQLAnnotatio
629627 }
630628
631629 GraphQLOutputType outputType = (GraphQLOutputType ) outputTypeFunction .buildType (method .getReturnType (), annotatedReturnType );
632- outputType = method .getAnnotation (NotNull .class ) == null ? outputType : new GraphQLNonNull (outputType );
633630
634631 boolean isConnection = isConnection (method , outputType );
635632 if (isConnection ) {
@@ -644,7 +641,7 @@ protected GraphQLFieldDefinition getField(Method method) throws GraphQLAnnotatio
644641 filter (p -> !DataFetchingEnvironment .class .isAssignableFrom (p .getType ())).
645642 map (parameter -> {
646643 Class <?> t = parameter .getType ();
647- graphql .schema .GraphQLType graphQLType = getInputObject (finalTypeFunction .buildType (t , parameter .getAnnotatedType ()), DEFAULT_INPUT_PREFIX );
644+ graphql .schema .GraphQLInputType graphQLType = getInputObject (finalTypeFunction .buildType (t , parameter .getAnnotatedType ()), DEFAULT_INPUT_PREFIX );
648645 return getArgument (parameter , graphQLType );
649646 }).collect (Collectors .toList ());
650647
@@ -755,10 +752,9 @@ public static GraphQLInputObjectType inputObject(GraphQLObjectType graphQLType,
755752 return (GraphQLInputObjectType ) getInstance ().getInputObject (graphQLType , newNamePrefix );
756753 }
757754
758- protected GraphQLArgument getArgument (Parameter parameter , graphql .schema .GraphQLType t ) throws
755+ protected GraphQLArgument getArgument (Parameter parameter , graphql .schema .GraphQLInputType t ) throws
759756 GraphQLAnnotationsException {
760- GraphQLArgument .Builder builder = newArgument ();
761- builder .type (parameter .getAnnotation (NotNull .class ) == null ? (GraphQLInputType ) t : new graphql .schema .GraphQLNonNull (t ));
757+ GraphQLArgument .Builder builder = newArgument ().type (t );
762758 GraphQLDescription description = parameter .getAnnotation (GraphQLDescription .class );
763759 if (description != null ) {
764760 builder .description (description .value ());
0 commit comments