Skip to content

Commit 7835a2d

Browse files
Merge branch 'main' into feature/type-reference-imrovements
2 parents 64669a7 + 080cffd commit 7835a2d

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Sources/GraphQL/Execution/Execute.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,16 +1018,9 @@ func completeLeafValue(returnType: GraphQLLeafType, result: Any?) throws -> Map
10181018
guard let result = result else {
10191019
return .null
10201020
}
1021-
10221021
let serializedResult = try returnType.serialize(value: result)
10231022

1024-
if serializedResult == .null {
1025-
throw GraphQLError(
1026-
message:
1027-
"Expected a value of type \"\(returnType)\" but " +
1028-
"received: \(result)"
1029-
)
1030-
}
1023+
// Do not check for serialization to null here. Some scalars may model literals as `Map.null`.
10311024

10321025
return serializedResult
10331026
}

0 commit comments

Comments
 (0)