diff --git a/Fauna.Test/Integration.Tests.cs b/Fauna.Test/Integration.Tests.cs index d1683e7a..4cf6dc5f 100644 --- a/Fauna.Test/Integration.Tests.cs +++ b/Fauna.Test/Integration.Tests.cs @@ -573,9 +573,10 @@ public void ValidateUnwrappedMapOfQueriesError() public async Task ValidateBytesAcrossTheWire() { byte[] byteArray = { 70, 97, 117, 110, 97 }; + byte[]? nullArray = null; - var result = await _client.QueryAsync(FQL($"let x:Bytes = {byteArray}; x")); + var result = await _client.QueryAsync>(FQL($"let x:Bytes = {byteArray}; let y:Bytes|Null = {nullArray}; [x,y]")); - Assert.AreEqual(Encoding.UTF8.GetBytes("Fauna"), result.Data); + Assert.AreEqual(new[] { Encoding.UTF8.GetBytes("Fauna"), null }, result.Data); } } diff --git a/Fauna/Serialization/DynamicSerializer.cs b/Fauna/Serialization/DynamicSerializer.cs index 9ba0d646..afc699fe 100644 --- a/Fauna/Serialization/DynamicSerializer.cs +++ b/Fauna/Serialization/DynamicSerializer.cs @@ -57,6 +57,7 @@ private DynamicSerializer() TokenType.Time => reader.GetTime(), TokenType.True or TokenType.False => reader.GetBoolean(), TokenType.Module => reader.GetModule(), + TokenType.Bytes => reader.GetBytes(), TokenType.Null => null, _ => throw new SerializationException( $"Unexpected token while deserializing: {reader.CurrentTokenType}"),