Skip to content

Commit 080cffd

Browse files
Merge pull request #109 from NeedleInAJayStack/fix/remove-null-scalar-check
fix: Removes null serialization check.
2 parents c7a26f7 + a88555b commit 080cffd

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)