feat(core): support HTTP QUERY requests - #3905
Draft
JoviDeCroock wants to merge 1 commit into
Draft
JoviDeCroock wants to merge 1 commit into
JoviDeCroock wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 917ee01 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Deploying urql with
|
| Latest commit: |
917ee01
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f66ee783.urql.pages.dev |
| Branch Preview URL: | https://feat-http-query-method.urql.pages.dev |
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.
Summary
preferQueryMethodclient and operation-context optionQUERYrequestsPOSTQUERYtake precedence over the existingpreferGetMethodbehaviorMotivation
RFC 10008 defines
QUERYas a safe, idempotent, body-bearing HTTP method. This maps well to GraphQL query operations without the URL-length constraints of GET.GraphQL over HTTP is discussing the mapping in graphql/graphql-over-http#411. This PR is intentionally a draft while that proposal and ecosystem support settle.
Behavior
When enabled, JSON query operations use uppercase
QUERYwith the same serialized JSON body used by POST. Mutations and subscriptions remain POST. Multipart/file-bearing queries also remain POST rather than introducing multipart QUERY behavior.The option takes precedence over
preferGetMethod, including its default'within-url-limit'value. It does not add automatic fallback on 405/501; opted-in deployments should expose unsupported server or intermediary configuration.Browser and infrastructure constraints
QUERYQUERYresponses yetTests
@urql/corebuild passedgit diff --checkpassed