ChilliCream / ChilliCream/graphql-platform

@defer on a UsePaging field hangs the incremental stream when a global field middleware is registered with UseField (v16 regression)

Open
#10,166 0 comments 1 reaction 1 assignee View on GitHub

@michaelstaib is already working on this.

Since Aug 4, 2026.

🌶️ hot chocolate
Dominant language
C#
Stars
5.8k
Forks
810
Avg merge
15h 39m
Merged PRs (30d)
98

Description

Product

Hot Chocolate

Version

16.5.0

Link to minimal reproduction

https://github.com/slam1t/hc16-defer-paging-fieldmiddleware-bug

Steps to reproduce

Reproduce the bug

dotnet run -- enableGlobalFieldMiddleware

Open Nitro at http://localhost:5095/graphql, or POST this query directly:

{
  pets {
    name
    ... on Pet @defer {
      dogs { nodes { name } }
    }
  }
}

Use Accept: multipart/mixed; deferSpec=20220824. The stream stalls after the
initial payload (hasNext: true, no incremental patches).

Example with curl:

curl -s -m 5 \
  -H "Content-Type: application/json" \
  -H "Accept: multipart/mixed; deferSpec=20220824" \
  -d '{"query":"{ pets { name ... on Pet @defer { dogs { nodes { name } } } } }"}' \
  http://localhost:5095/graphql

Expected (buggy) response — last part received, then the connection hangs:

{"data":{"pets":[{"name":"p1"},{"name":"p2"}]},"pending":[{"id":"2","path":["pets",0]},{"id":"3","path":["pets",1]}],"hasNext":true}

Control (works)

dotnet run

Run the same query. Incremental patches for dogs are delivered and the stream
completes with hasNext: false.

What triggers it

All three are required:

  1. @defer on a field
  2. That field uses UsePaging (connection with nodes)
  3. A global field middleware registered via .UseField<>() (even a pass-through)

Removing any one of these delivers normally.

What is expected?

Query with Deferred paginated field completes

What is actually happening?

Query with Deferred paginated field hangs with no sign of completion

Relevant log output

Additional context

Note this worked in HC15. We discovered this bug when we migrated to HC16.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.