graphql / graphql/graphql-spec

RFC: Standardize `application/graphql` with `.graphql` extension

Open
#988 7 comments 11 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
14.6k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Based on @leebyron suggestion in #203:
> I’m happy to entertain a formal RFC to add errata to the spec to explain
that .graphql is the preferred extension when saving files in the graphql
language.

I propose to submit `application/graphql` with `.graphql` as an extension to the official MIME DB:
https://www.iana.org/assignments/media-types/media-types.xhtml
`application/graphql` already used by community see:
https://grep.app/search?q=application/graphql

Note: technically, there are substantial benefits to having it as `text/graphql` (same as `text/html`). For example, OS will open files with a text editor, and browsers show content as text.
But since `application/graphql` is already in many places standardizing on `text/graphql` will add a lot of confusion.

It looks like the process of submitting MIME type is pretty straightforward:
https://www.iana.org/form/media-types
We just need to claim it in a spec and submit the form.

I will work on spec PR in a short while, I just want to use this issue as a talking point for discussion in https://github.com/graphql/graphql-over-http repo.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.