Fix test harness for HotChocolate to match graphql-js#11
Open
michaelstaib wants to merge 1 commit intojbellenger:masterfrom
Open
Fix test harness for HotChocolate to match graphql-js#11michaelstaib wants to merge 1 commit intojbellenger:masterfrom
michaelstaib wants to merge 1 commit intojbellenger:masterfrom
Conversation
3 tasks
jbellenger
added a commit
that referenced
this pull request
Apr 20, 2026
## Summary
- Impls that natively support incremental delivery now emit
`multipart/mixed` per the GraphQL incremental-delivery spec; the
conformer parses and merges the parts into a single collapsed `{data,
errors?, extensions?}` object before comparison.
- Hot Chocolate and graphql-js-17 both updated; HC previously dropped
every incremental patch, and the 17 driver previously rejected every
schema that declared @defer/@stream directives.
- `conformer/src/execute.js:applyIncrementalMerge` replaced with a
path-based merger covering the two items flagged in a prior review of
#11:
- **P1**: `@stream` items' last path segment is an insertion index; the
merger splices into the parent array (and also supports pending-id forms
where the resolved path points directly at the list, which HC uses).
- **P2**: repeated `@defer` patches at the same parent path deep-merge
so nested object keys don't overwrite each other.
- SPEC.md §374-376 rewritten to describe the multipart-in /
collapsed-out contract and cross-reference the existing HTTP rules.
- New hand-crafted sanity case at `corpus/0/1/query.graphql` exercises
`@defer` + `@stream(initialCount: 1)` end-to-end;
`corpus/0/schema.graphqls` gains the directive declarations.
## Tests
- 21 unit tests in `conformer/src/execute.test.js` cover P1, P2,
pending-id resolution (both initial and subsequent-part pending
entries), subPath handling, HC's `{"data": null, "items": [...]}` shape,
error aggregation across initial/chunk-top-level/per-incremental
entries, extensions preservation, and malformed-part resilience.
- Docker-gated integration test in
`conformer/src/hot-chocolate.driver.test.js` boots the HC container,
posts a `@defer`+`@stream` query, and asserts that the response is
`multipart/mixed` with ≥2 parts that collapse to the wiring-spec shape.
Skips automatically when Docker is unreachable.
- `make run-conformer --drivers graphql-js-17,hot-chocolate` on
`corpus/0` passes 2/2 for both drivers (initial query + the new
defer/stream case).
## Out of scope
- Defer/stream support for other impls (juniper, async-graphql,
graphql-go, graphql-php, graphql-dotnet, graphql-ruby, absinthe,
lacinia, viaduct, graphql-js-16, gqlgen, graphql-java, graphql-core,
grafast) — follow-up PR.
- Fuzzed-corpus injection of `@defer`/`@stream` — follow-up.
## Test plan
- [ ] `make test` — unit + integration tests green (80/80 locally).
- [ ] `make run-conformer` on `corpus/0` — HC and graphql-js-17 both
pass the new `0/1` case.
- [ ] Differential check: `hot-chocolate.driver.test.js` asserts the
multipart wire format (not a collapsed JSON body).
Owner
|
Hi Michael! Thanks for putting this together! The terrain of this project has changed a bit since you first posted this, though I've applied the spirit of your PR in #17, and there'll be an additional follow-up PR to address incremental directives more uniformly. I'm honored that you put together this PR, but for the next 1-2 weeks I think this project is going to be in a high state of flux and might be too unstable for external contributions. I'd really like to work with you and HotChocolate though -- for the time being can you file github issues or start a github discussion about things you'd like to see? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.