@@ -1016,7 +1016,7 @@ function completeValue(
1016
1016
// If field type is a leaf type, Scalar or Enum, serialize to a valid value,
1017
1017
// returning null if serialization is not possible.
1018
1018
if ( isLeafType ( returnType ) ) {
1019
- return completeLeafValue ( returnType , result ) ;
1019
+ return { data : completeLeafValue ( returnType , result ) } ;
1020
1020
}
1021
1021
1022
1022
// If field type is an abstract type, Interface or Union, determine the
@@ -1119,10 +1119,7 @@ function flattenEPRs(
1119
1119
* Complete a Scalar or Enum by serializing to a valid value, returning
1120
1120
* null if serialization is not possible.
1121
1121
*/
1122
- function completeLeafValue (
1123
- returnType : GraphQLLeafType ,
1124
- result : mixed ,
1125
- ) : ExecutionPartialResult < mixed > {
1122
+ function completeLeafValue ( returnType : GraphQLLeafType , result : mixed ) : mixed {
1126
1123
invariant ( returnType . serialize , 'Missing serialize method on type' ) ;
1127
1124
const serializedResult = returnType . serialize ( result ) ;
1128
1125
if ( isInvalid ( serializedResult ) ) {
@@ -1131,7 +1128,7 @@ function completeLeafValue(
1131
1128
`received: ${ String ( result ) } ` ,
1132
1129
) ;
1133
1130
}
1134
- return { data : serializedResult } ;
1131
+ return serializedResult ;
1135
1132
}
1136
1133
1137
1134
/**
0 commit comments