Giter Club home page Giter Club logo

Comments (10)

spawnia avatar spawnia commented on May 5, 2024 2

I think this issue can be closed, as #161 is merged.

from graphql-over-http.

mmatsa avatar mmatsa commented on May 5, 2024 1

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.

sungam3r avatar sungam3r commented on May 5, 2024 1

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.

benjie avatar benjie commented on May 5, 2024 1

@kettanaito That's the intention after the watershed, but before then very few servers are likely to support it.

from graphql-over-http.

sjparsons avatar sjparsons commented on May 5, 2024

@mmatsa might be worth reading this PR and seeing whether there's some overlap. #83

from graphql-over-http.

kettanaito avatar kettanaito commented on May 5, 2024

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.

kettanaito avatar kettanaito commented on May 5, 2024

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.

Shane32 avatar Shane32 commented on May 5, 2024

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.

Shane32 avatar Shane32 commented on May 5, 2024

(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.

benjie avatar benjie commented on May 5, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.