Repository navigation
Conversation
This was referenced Nov 14, 2026
simPod
force-pushed
the
feat/http-response-negotiation
branch
from
November 14, 2026 20:01
14f8f57 to
3213f63
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Accept-header parsing splits commas inside quoted parameter values, allowing requests that should receive 406 to execute operations instead.
1 open issue
What changed in this PR
Adds opt-in response negotiation to StandardServer, establishing the response layer for later GraphQL-over-HTTP status mapping while preserving legacy behavior.
Changes:
- Adds the disabled-by-default
graphqlOverHttpconfiguration option. - Shares response handling across PHP-global and PSR-7 entry points, including asynchronous execution, media type selection, early 406 responses, and
Varypreservation. - Documents the option and adds negotiation and compatibility tests.
| File | Description |
|---|---|
tests/Server/ServerConfigTest.php |
Verifies negotiation is disabled by default. |
tests/Server/HttpServerTest.php |
Covers negotiation, legacy behavior, asynchronous responses, and early rejection. |
src/Server/StandardServer.php |
Integrates opt-in negotiation into both HTTP response paths. |
src/Server/ServerConfig.php |
Adds the configuration option and accessors. |
src/Server/HttpResponse.php |
Emits negotiated responses through PHP globals or PSR-7. |
src/Server/HttpHelper.php |
Selects response media types and constructs responses. |
docs/executing-queries.md |
Explains opt-in usage and caller responsibilities. |
docs/class-reference.md |
Documents the new configuration setter. |
Review effort: Balanced
simPod
force-pushed
the
feat/http-response-negotiation
branch
from
November 14, 2026 21:02
3213f63 to
84e3566
Compare
simPod
force-pushed
the
feat/http-response-negotiation
branch
from
November 15, 2026 07:54
84e3566 to
22fd15c
Compare
Add an explicit server option and shared response handling for PHP globals and PSR-7. Keep legacy defaults unchanged while negotiating modern GraphQL response media types.
simPod
force-pushed
the
feat/http-response-negotiation
branch
from
November 18, 2026 11:24
22fd15c to
b928394
Compare
This branch has not been deployed
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.

StandardServer always emits application/json and does not consider the client Accept header. The September 2026 GraphQL-over-HTTP specification defines a response media type and negotiation rules that require an explicit HTTP response path.
Add an opt-in graphqlOverHttp option rather than change existing behavior for current clients and framework integrations. Share response handling between PHP globals and PSR-7, respect media type priorities and wildcards, return 406 before execution when no representation is acceptable, and preserve existing Vary values. Keep request-specific response choices local to each operation, including promise-based execution.
Applications that build their own responses through executeRequest() or executePsrRequest() still own response negotiation and status codes.
Second in the HTTP stack, after #2007. This establishes the response layer used by the following status-mapping change. Negotiation does not inherently require the execution metadata, but status mapping needs both foundations. Strict request parsing follows separately; this PR alone does not provide complete protocol support.
Specification: https://http-spec.graphql.org/September2026/
Stack: #2007 → #2008 → #2009 → #2010.
Changelog