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