File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ function coerceValue(type: GraphQLInputType, value: any): any {
130130 return coerceValue ( nullableType , value ) ;
131131 }
132132
133- if ( isNullish ( value ) ) {
133+ if ( value === undefined ) {
134134 return null ;
135135 }
136136
@@ -148,10 +148,9 @@ function coerceValue(type: GraphQLInputType, value: any): any {
148148 return Object . keys ( fields ) . reduce ( ( obj , fieldName ) => {
149149 var field = fields [ fieldName ] ;
150150 var fieldValue = coerceValue ( field . type , value [ fieldName ] ) ;
151- if ( isNullish ( fieldValue ) ) {
151+ if ( fieldValue === undefined ) {
152152 fieldValue = field . defaultValue ;
153- }
154- if ( ! isNullish ( fieldValue ) ) {
153+ } else {
155154 obj [ fieldName ] = fieldValue ;
156155 }
157156 return obj ;
@@ -162,6 +161,10 @@ function coerceValue(type: GraphQLInputType, value: any): any {
162161 type instanceof GraphQLScalarType || type instanceof GraphQLEnumType ,
163162 'Must be input type'
164163 ) ;
164+
165+ if ( value === null ) {
166+ return null ;
167+ }
165168
166169 var parsed = type . parseValue ( value ) ;
167170 if ( ! isNullish ( parsed ) ) {
You can’t perform that action at this time.
0 commit comments