Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
using HotChocolate.Execution.Internal;
using HotChocolate.Types;
using Microsoft.Extensions.DependencyInjection;
using System.Runtime.InteropServices;

namespace HotChocolate.Execution.Processing.Tasks;

Expand Down Expand Up @@ -185,7 +185,10 @@ private async ValueTask ExecuteResolverPipelineAsync(CancellationToken cancellat
{
count++;
next = await enumerator.MoveNextAsync().ConfigureAwait(false);
list.Add(enumerator.Current);
if (next)
{
list.Add(enumerator.Current);
}

if (count >= initialCount)
{
Expand Down
20 changes: 20 additions & 0 deletions src/HotChocolate/Core/test/Execution.Tests/StreamTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,26 @@ persons @stream(initialCount: 1) {
Assert.IsType<ResponseStream>(result).MatchSnapshot();
}

[LocalFact]
public async Task Stream_InitialCount_Exceeds_Total_Count()
{
// arrange
var executor = await DeferAndStreamTestSchema.CreateAsync();

// act
var result = await executor.ExecuteAsync(
@"{
... @defer {
wait(m: 300)
}
persons @stream(initialCount: 7) {
id
}
}");

Assert.IsType<ResponseStream>(result).MatchSnapshot();
}

[LocalFact]
public async Task Stream_Label_Set_To_abc()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"data": {
"persons": [
{
"id": "UGVyc29uOjE="
},
{
"id": "UGVyc29uOjI="
},
{
"id": "UGVyc29uOjM="
},
{
"id": "UGVyc29uOjQ="
}
],
"wait": true
}
}
Loading