Skip to content

RECOMMENDED to SHOULD - #416

Open
benjie wants to merge 6 commits into
mainfrom
recommended2should
Open

RECOMMENDED to SHOULD#416
benjie wants to merge 6 commits into
mainfrom
recommended2should

Conversation

@benjie

@benjie benjie commented Aug 3, 2026

Copy link
Copy Markdown
Member

Before merging this, merge:


I am not particularly in favor of this change; but if we're going to do it we should do it right... I have put some normative changes in this, for example previously we RECOMMENDED that URLs end with /graphql but I'm not willing to say that they SHOULD end with /graphql (even though they have the same weight in RFC2119) so I've noted that it's a common convention instead.

I would recommend that people create their GraphQL APIs at /graphql or similar. Doing so is recommended.

For someone who has deployed their GraphQL API at https://example.com/api or https://graphql.example.com I would not say that they "SHOULD NOT" have done that. It's fine.

Comment thread spec/GraphQLOverHTTP.md
execution. Using `405` (Method Not Allowed) is RECOMMENDED. This restriction is
necessary to conform with the long-established semantics of safe methods within
HTTP.
execution; status code `405` (Method Not Allowed) is RECOMMENDED. This

@benjie benjie Aug 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left this RECOMMENDED in place, it's the only one, but writing the sentence to use both MUST and SHOULD read really awkwardly and I believe RFC2119 gives us a choice of words to allow us to avoid these kinds of linguistic shenanigans.

Comment thread spec/GraphQLOverHTTP.md
Comment on lines -356 to +357
to add additional information to a request they MUST do so via other means; the
RECOMMENDED approach is to add an implementer-scoped entry to the {extensions}
object.
to add additional information to a request they MUST do so via other means, for
example by adding an implementer-scoped entry to the {extensions} object.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding to extensions is the "recommended" approach; but if you choose to set it via headers I wouldn't say you "should not" have done that. So I've lowered this to an example.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This read better with RECOMMENDED.

A possible direction might be to point out that this is one of the reasons the extensions object exists and link to the spec for more informations. That would be more informative to users new to the spec.

@benjie
benjie force-pushed the recommended2should branch from b337df2 to d4094f1 Compare August 3, 2026 09:17
@benjie
benjie changed the base branch from main to ietf-rfc August 3, 2026 09:17
@benjie
benjie force-pushed the recommended2should branch from d4094f1 to d38c825 Compare August 3, 2026 09:21
@benjie benjie mentioned this pull request Aug 3, 2026
@benjie
benjie force-pushed the recommended2should branch from d38c825 to 89f6e06 Compare August 3, 2026 09:40

@martinbonnin martinbonnin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RECOMMENDED wording grew on me. I've spent a couple of years with this spec using RECOMMENDED and it worked fine by me. All in all no strong opposition but also no strong drive to change this. I'll abstain.

@benjie
benjie force-pushed the recommended2should branch from 89f6e06 to 36f8f38 Compare August 3, 2026 21:01

@alf alf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong opinions, both before and after looks good to me.

Comment thread spec/GraphQLOverHTTP.md
Comment on lines +137 to +138
It is a common convention to end the path component of the URL with `/graphql`,
for example:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of graphql security hardening guides argue against using /graphql. My take is that if you're relying on the fact that your endpoint is non-standard for security then you're at a bad place.

Still, I don't really see the benefit of recommending the path component. While it's all about discoverability for developers/tooling, it isn't something we can rely on. Saying that this is a common convention is better than recommending that implementers follow the convention. Good change.

Comment thread spec/GraphQLOverHTTP.md
Comment on lines 243 to 245
If it is not known that the server supports `application/graphql-response+json`,
it is RECOMMENDED that the client set the `Accept` header to
the client SHOULD set the `Accept` header to
`application/graphql-response+json, application/json;q=0.9`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why shouldn't the client set the Accept header to application/graphql-response+json, application/json;q=0.9 if it is known that the server supports application/graphql-response+json? 😸

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it knows the server supports the desired media type, why Accept a worse one when you know it should never be used?

Comment thread spec/GraphQLOverHTTP.md
Comment on lines -356 to +357
to add additional information to a request they MUST do so via other means; the
RECOMMENDED approach is to add an implementer-scoped entry to the {extensions}
object.
to add additional information to a request they MUST do so via other means, for
example by adding an implementer-scoped entry to the {extensions} object.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This read better with RECOMMENDED.

A possible direction might be to point out that this is one of the reasons the extensions object exists and link to the spec for more informations. That would be more informative to users new to the spec.

Base automatically changed from ietf-rfc to main August 5, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SHOULD over RECOMMENDED

5 participants