GithubHelp home page GithubHelp logo

Comments (5)

spawnia avatar spawnia commented on May 3, 2024 2

I think that directed is meant to say that clients should send their requests to that endpoint, not that the server should magically redirect all GraphQL requests there.

That said, the fact that this can be understood in different ways is all the more reason to clarify that section of the spec.

from graphql-over-http.

spawnia avatar spawnia commented on May 3, 2024

The current spec text answers this question, albeit a bit vaguely.

A GraphQL server operates on a single URL and all GraphQL requests for a given service should be directed at this URL. Other protocols may also use that URL.

I think that we are somewhere inbetween option 2 and 3 (Hint: 2 currently shows as 12, formatting is borked). It is crucial we clarify this part.

how do we distinguish between GraphQL and non-GraphQL requests?

That's a question we must answer.

One part of the definition is that the server must designate a particular URL to handling GraphQL requests. That already rules out 1. and also opens up flexibility, e.g. a single server with multiple schemas/endpoints. 1 endpoint on a server = 1 GraphQL server.

The other part is that we have to define which requests to that endpoint must be interpreted as GraphQL and answered accordingly.

from graphql-over-http.

ghmcadams avatar ghmcadams commented on May 3, 2024

Thanks, @spawnia. I fixed the formatting.

I agree that we are between 2 and 3, though it feels to me that the current text implies number 1. If the server operates on a single URL (endpoint) and all GraphQL requests should be directed to that URL, then there is effectively only one endpoint and all traffic goes there.

from graphql-over-http.

ralfhandl avatar ralfhandl commented on May 3, 2024

Looking at the current text here's my understanding:

A GraphQL server operates on a single URL

So a GraphQL server may be an HTTP server (1) if and only if that single URL only consists of scheme, host, and optional port, and does not have a path, e.g. https://graphql.some.com.

If the single URL has a path, the GraphQL server is something running behind a path, side-by-side with other stuff served by the HTTP server identified via host and port (2 or 3).

and all GraphQL requests for a given service should be directed at this URL.

That's just advice for the client. Sending a GraphQL request to https://www.some.com/products/FAQ.html may not result in a GraphQL response, better send it to https://www.some.com/products/graphql 😄

Other protocols may also use that URL.

So that means (2).

from graphql-over-http.

spawnia avatar spawnia commented on May 3, 2024

I have written up a clarification of what i think are the minimal requirements and the reasoning behind it: #94

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.