@@ -56,7 +56,9 @@ protected ExecutionResult completeValue(ExecutionContext executionContext, Graph
5656 if (fieldType instanceof GraphQLNonNull ) {
5757 GraphQLNonNull graphQLNonNull = (GraphQLNonNull ) fieldType ;
5858 ExecutionResult completed = completeValue (executionContext , graphQLNonNull .getWrappedType (), fields , result );
59- if (completed == null ) throw new GraphQLException ("Cannot return null for non-nullable type: " + fields );
59+ if (completed == null ) {
60+ throw new GraphQLException ("Cannot return null for non-nullable type: " + fields );
61+ }
6062 return completed ;
6163
6264 } else if (result == null ) {
@@ -94,13 +96,17 @@ protected ExecutionResult completeValue(ExecutionContext executionContext, Graph
9496
9597 protected GraphQLObjectType resolveType (GraphQLInterfaceType graphQLInterfaceType , Object value ) {
9698 GraphQLObjectType result = graphQLInterfaceType .getTypeResolver ().getType (value );
97- if (result == null ) throw new GraphQLException ("could not determine type" );
99+ if (result == null ) {
100+ throw new GraphQLException ("could not determine type" );
101+ }
98102 return result ;
99103 }
100104
101105 protected GraphQLObjectType resolveType (GraphQLUnionType graphQLUnionType , Object value ) {
102106 GraphQLObjectType result = graphQLUnionType .getTypeResolver ().getType (value );
103- if (result == null ) throw new GraphQLException ("could not determine type" );
107+ if (result == null ) {
108+ throw new GraphQLException ("could not determine type" );
109+ }
104110 return result ;
105111 }
106112
@@ -136,7 +142,9 @@ protected GraphQLFieldDefinition getFieldDef(GraphQLSchema schema, GraphQLObject
136142 }
137143
138144 GraphQLFieldDefinition fieldDefinition = parentType .getFieldDefinition (field .getName ());
139- if (fieldDefinition == null ) throw new GraphQLException ("unknown field " + field .getName ());
145+ if (fieldDefinition == null ) {
146+ throw new GraphQLException ("unknown field " + field .getName ());
147+ }
140148 return fieldDefinition ;
141149 }
142150
0 commit comments