Repository navigation
Serve GraphQL over HTTP from greem::http and audit it with graphql-http - #47
Merged
Merged
Conversation
Owner
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6950f1f27b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
greem::http::handle takes the parts of an HTTP request (method, query string, Content-Type, Accept and the body) and answers a Response. It serves GET, and POST and QUERY with an application/json body, and negotiates Accept with q-values between application/graphql-response+json, legacy application/json and multipart/mixed. Status codes follow the GraphQL-over-HTTP draft: 400 for a body or document that does not parse, 422 for other request errors and for malformed parameters, 294 for data alongside errors, 405 for a mutation over GET, and 406 and 415 for media types it cannot serve. QUERY (RFC 10008) runs queries only and answers a mutation with 422, as graphql/graphql-over-http#411 proposes ahead of the draft. Request errors carry a RequestErrorKind, so the status follows the step that failed. The http feature converts from http::request::Parts and into an http::Response whose body is an http_body::Body. The axum example and greem-bench's serve binary now hand each request to it instead of keeping their own copies of the same handler. ADR-0012 records following the draft where graphql-http's audits disagree. Closes #21 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
http-audit/ runs graphql-http 1.23.1's server audits against a URL and fails on a MUST error, on a SHOULD warning that overrides.json does not name, and on an override whose audit no longer warns. The four overrides are where graphql-http contradicts the GraphQL-over-HTTP draft greem follows: 200 for request errors under application/json, and 400 for variable coercion failures. Each one cites the draft section it contradicts. http-audit.yml starts the axum example, audits it, writes the report to the job summary and uploads it. http-audit-comment.yml runs on that workflow's completion from the default branch, so it has a write token even for forks' pull requests. It posts the report as one comment per pull request, updated in place, and finds the pull request from the event, not from the artifact. The repository root becomes a pnpm workspace holding http-audit, and bench/ becomes its own workspace with the graphql-js server's lockfile. mise.toml pins pnpm beside Node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 16, 2026
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.
Summary
greem::http::handleowns the whole GraphQL-over-HTTP exchange that the axum example andgreem-bench'sserveeach used to hand-write. CI then audits it with graphql-http.Status codes follow the GraphQL-over-HTTP draft, not graphql-http's audits where the two disagree (ADR-0012). A legacy
application/jsonclient gets the same codes, and only a 2xx keepsapplication/json. QUERY (RFC 10008) is served like POST but only for queries, as graphql-over-http#411 proposes ahead of the draft, whose "MAY support other methods" already allows it.The
httpfeature is opt-in. actix-web sits onhttp0.2, so the core takes plain&str/&[u8]parts.bench/becomes its own pnpm workspace, andmise.tomlnow pins pnpm.Evidence
Before: graphql-http 1.23.1 against
examples/axumhad 0 errors, 4 warnings (22EB, 572B, FDE2, 7B9B) and 15 notices. GET wasn't served (5A70, D6D5, 6A70), and nothing ever answeredapplication/graphql-response+json.After: 39 pass, 0 errors, and 4 warnings, all overridden as draft conflicts:
application/jsonapplication/jsongraphql-response+jsonThe 18 notices are the MAY-level "400 for malformed parameters" audits; greem answers 422, as the draft says. 74FF passes, because its "validation failure" document doesn't even lex.
Over a real socket,
curl -X QUERYagainst the example gets 200 for a query and 422 for a mutation, andPUTgets405 Allow: GET, POST, QUERY. graphql-http has no QUERY audits, so the audit result is unchanged.The gate fails as it should: with 86EE removed from the overrides and the passing 74FF added, the audit exits 1 and reports both problems.
cargo test -p greem --all-features --test http: 13 cases covering every status path, plushttpround-trips. The example andservetests, workspace clippy, docs, MSRV 1.96, and thebench/workspace build all pass.Merge Danger
Door: two-way
The comment workflow only runs from
main(workflow_run), so this PR shows the report in the job summary; the first sticky comment will appear on the next PR.Blast Radius: API
RequestErrorsbecomes{ kind, errors },PayloadKind::RequestErrorcarries aRequestErrorKind, andgreem::http::accepts_multipartis gone.; charset=utf-8in their content type.handleneeds a follow-up.Closes #21
🤖 Generated with Claude Code