DevKits

application/*

application/graphql

File extensions: .graphql, .gql

Raw GraphQL query strings, sent to a GraphQL endpoint.

What is application/graphql?

application/graphql is used to POST a raw GraphQL query as the request body. Most GraphQL servers, however, expect a JSON body with a `query` field — check your target server before using this type.

Typical usage

GraphQL client libraries that send raw query strings.

Common gotchas

The GraphQL over HTTP working draft standardizes application/json (with a JSON wrapper) as the preferred body format. Prefer JSON unless your server explicitly supports application/graphql.

HTTP header example

Response header

Content-Type: application/graphql; charset=utf-8

Registration status

This media type is not officially registered with IANA. It is widely used in practice, but strict clients or standards-conformant tooling may not recognize it — check your consumer's tolerance.

Frequently asked questions

What is the application/graphql MIME type?

application/graphql is used to POST a raw GraphQL query as the request body. Most GraphQL servers, however, expect a JSON body with a `query` field — check your target server before using this type.

What file extension does application/graphql use?

Files served as application/graphql typically use the extensions .graphql, .gql. The most common is .graphql.

How do I set the Content-Type for application/graphql?

Send the HTTP response header Content-Type: application/graphql; charset=utf-8. GraphQL client libraries that send raw query strings.

Is application/graphql an official MIME type?

No. application/graphql is not officially registered with IANA. It is widely used in practice, but strict or standards-conformant tooling may not recognize it, so verify your consumer accepts it.

What are common mistakes with application/graphql?

The GraphQL over HTTP working draft standardizes application/json (with a JSON wrapper) as the preferred body format. Prefer JSON unless your server explicitly supports application/graphql.

Related MIME types