Skip to content

Remove application/json response section; additional editorial#404

Open
benjie wants to merge 27 commits into
mainfrom
legacy-client-editorial
Open

Remove application/json response section; additional editorial#404
benjie wants to merge 27 commits into
mainfrom
legacy-client-editorial

Conversation

@benjie

@benjie benjie commented Jun 23, 2026

Copy link
Copy Markdown
Member

This pull request simplifies the GraphQL-over-HTTP spec by removing the sections on the legacy Content-Type: application/json response type, and instead handling it through a recommendation: honour a request for application/json on successful requests, and use application/graphql-response+json for all other responses1. This small change maintains broad (but not full) compatibility with legacy GraphQL clients without requiring an entire dedicated section (or appendix) detailing these rules.

Further, I've done a full review of the specification and made a few other adjustments based on expected upcoming needs.

Footnotes

  1. This is paraphrased, read the actual text for the specific wording.

Comment thread spec/GraphQLOverHTTP.md
Comment thread spec/GraphQLOverHTTP.md
Comment thread spec/GraphQLOverHTTP.md Outdated
Comment on lines +441 to +445
To improve compatibility with _legacy client_, if the `Accept` header does not
indicate support for one of the server's preferred media types but does indicate
support for `application/json`, it is RECOMMENDED to perform the request as if
it had `Accept: application/graphql-response+json` but use
`Content-Type: application/json` for any response with a `2xx` status code.

@benjie benjie Jun 23, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the key new paragraph. This normative paragraph, this recommendation, eliminates most of the need for the application/json section in the spec (whether that be in the spec or in an appendix).

From what I understand, this follows the behavior that @michaelstaib has already implemented in HotChocolate.

Comment thread spec/GraphQLOverHTTP.md

@martinbonnin martinbonnin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 👍

PS: good job on filing this as PR #404 😄

@benjie

benjie commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

cc @Shane32 @PascalSenn @jerelmiller

Comment thread spec/GraphQLOverHTTP.md Outdated
benjie and others added 2 commits June 23, 2026 16:08
Co-authored-by: Benoit 'BoD' Lubek <BoD@JRAF.org>
@benjie benjie changed the title Remove legacy application/json response format; additional editorial Remove application/json response section; additional editorial Jun 23, 2026
Comment thread spec/GraphQLOverHTTP.md Outdated
Comment thread spec/GraphQLOverHTTP.md
is RECOMMENDED.
- If the client did not produce a request within the time that the server was
prepared to wait, status code `408` is RECOMMENDED.
- If the size of the URI was too large, status code `414` is RECOMMENDED (and

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing a ) somewhere here? That (and \422` is RECOMMENDED.` looks kinda out of place to me in general.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be seeing a rendering bug? Here’s what I see:

Image

@jerelmiller jerelmiller left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the changes! "does not conform to this specification" is so much simpler. Appreciate the updates!

Comment thread spec/GraphQLOverHTTP.md Outdated
Comment thread spec/GraphQLOverHTTP.md Outdated
Comment thread spec/GraphQLOverHTTP.md
@benjie

benjie commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

Thanks for the feedback everyone; I've done some small tweaks to the wording to add clarity (and sidestep the plurality problem). If you're happy, we can get this merged and present the GraphQL-over-HTTP spec to the GraphQL WG tomorrow ready to join the main spec for spec cut in September!

Please slap another ✅ on this even if it seems redundant. cc @michaelstaib @martinbonnin @Shane32 @jerelmiller @phryneas @BoD @PascalSenn

@jerelmiller jerelmiller left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate it!

@martinbonnin martinbonnin mentioned this pull request Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants