File tree 1 file changed +7
-4
lines changed 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 {
130
130
return coerceValue ( nullableType , value ) ;
131
131
}
132
132
133
- if ( isNullish ( value ) ) {
133
+ if ( value === undefined ) {
134
134
return null ;
135
135
}
136
136
@@ -148,10 +148,9 @@ function coerceValue(type: GraphQLInputType, value: any): any {
148
148
return Object . keys ( fields ) . reduce ( ( obj , fieldName ) => {
149
149
var field = fields [ fieldName ] ;
150
150
var fieldValue = coerceValue ( field . type , value [ fieldName ] ) ;
151
- if ( isNullish ( fieldValue ) ) {
151
+ if ( fieldValue === undefined ) {
152
152
fieldValue = field . defaultValue ;
153
- }
154
- if ( ! isNullish ( fieldValue ) ) {
153
+ } else {
155
154
obj [ fieldName ] = fieldValue ;
156
155
}
157
156
return obj ;
@@ -162,6 +161,10 @@ function coerceValue(type: GraphQLInputType, value: any): any {
162
161
type instanceof GraphQLScalarType || type instanceof GraphQLEnumType ,
163
162
'Must be input type'
164
163
) ;
164
+
165
+ if ( value === null ) {
166
+ return null ;
167
+ }
165
168
166
169
var parsed = type . parseValue ( value ) ;
167
170
if ( ! isNullish ( parsed ) ) {
You can’t perform that action at this time.
0 commit comments