Comments (10)
I think this issue can be closed, as #161 is merged.
from graphql-over-http.
I think I can write a first draft for this, after the next mtg.
I'm not sure which direction to go for it, so that first draft might be very preliminary and include options or notes
for discussion.
from graphql-over-http.
As per the current state of the spec, the server can recognize a client request as a GraphQL request by the Content-Type header value. It should equal application/graphql+json if the request is intended to be handled as a GraphQL request.
Things changed. Now server should deal with Accept
header. No application/graphql+json
mime for requests anymore, application/graphql-response+json
only for responses.
from graphql-over-http.
@kettanaito That's the intention after the watershed, but before then very few servers are likely to support it.
from graphql-over-http.
@mmatsa might be worth reading this PR and seeing whether there's some overlap. #83
from graphql-over-http.
As per the current state of the spec, the server can recognize a client request as a GraphQL request by the Content-Type
header value. It should equal application/graphql+json
if the request is intended to be handled as a GraphQL request.
from graphql-over-http.
Oh, that's useful! Thanks, @sungam3r.
To recap, is this the expected transaction?
Request:
POST /graphql
Accept: application/graphql-response+json
Content-Type: application/json // still need to describe sent body
{"query":"..."}
Response:
200 OK /graphql
Content-Type: application/graphql-response+json
from graphql-over-http.
The server may respond with Content-Type: application/graphql-response+json; charset=utf-8
See: https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md#media-types
from graphql-over-http.
(For GraphQL.NET Server 7.1, released a few days ago, that is the default response content type, but the server will honor recognized ‘Accept’ headers.)
from graphql-over-http.
In the mean time, it
is RECOMMENDED that a client set the Accept header to
application/graphql-response+json; charset=utf-8, application/json; charset=utf-8
.
-- https://graphql.github.io/graphql-over-http/draft/#sel-EALHLDFAADHCA_zQ
This should maximize compatibility. If you want to use @stream
/@defer
then things get a little more complex...
from graphql-over-http.
Related Issues (20)
- [2022-06-27] Copy over relevant issue labels from main spec repo HOT 2
- [2022-06-27] Schedule a meeting after the July spec WG
- Spec references RFC7231 which is obsoleted HOT 4
- Response status code as `application/json` content HOT 5
- Clarify the use of HTTP GET and POST request HOT 2
- Status codes for unauthenticated OAuth errors HOT 1
- Optional query discussion HOT 13
- GraphQL request optional parameters HOT 2
- Kitchen sink HTTP requests HOT 3
- Allow non-UTF-8 encodings HOT 2
- What is well-formed response HOT 3
- Status codes 404 and 410 HOT 1
- Clarification for `Accept: */*` HOT 8
- Should we explicitly support `Content-Type: application/graphql`? HOT 13
- Should the query property really be required? HOT 1
- Make it clear that extra keys in the request/response payloads are not allowed HOT 2
- [2023-10] Add changes promoting spec to RFC 2 status
- [2023-10] Add RFC2 status to next GraphQL Spec WG HOT 1
- Create the "Action Item" issue template
- [2023-11] Add notes about security to GraphQL-over-HTTP spec HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-over-http.