Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/execution/execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ function completeValue(
// If field type is a leaf type, Scalar or Enum, serialize to a valid value,
// returning null if serialization is not possible.
if (isLeafType(returnType)) {
return completeLeafValue(returnType, result);
return completeLeafValue(returnType, result, fieldNodes, info);
}

// If field type is an abstract type, Interface or Union, determine the
Expand Down Expand Up @@ -935,8 +935,8 @@ function completeListValue(
* Complete a Scalar or Enum by serializing to a valid value, returning
* null if serialization is not possible.
*/
function completeLeafValue(returnType: GraphQLLeafType, result: mixed): mixed {
const serializedResult = returnType.serialize(result);
function completeLeafValue(returnType: GraphQLLeafType, result: mixed, fieldNodes: $ReadOnlyArray<FieldNode>, info: GraphQLResolveInfo): mixed {
const serializedResult = returnType.serialize(result, fieldNodes, info);
if (isInvalid(serializedResult)) {
throw new Error(
`Expected a value of type "${inspect(returnType)}" but ` +
Expand Down