Comments (5)
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.
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.
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.
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.
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)
- [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.