.graphql

What is a .graphql file?

GraphQL is a query language for APIs — clients ask for exactly the data they need, nothing more, nothing less.

Safe format
Type Code
By Facebook (now Meta)
MIME application/graphql

Drop any file to identify it

No upload. No signup. No sending your file halfway across the internet.
We tell you what it is, right here in your browser.

What is it

GraphQL solves the problem of REST APIs returning too much or too little data. Instead of hitting multiple endpoints and filtering client-side, a GraphQL query describes exactly what data you want, in what shape, and the server returns precisely that. One request, one response, exactly the fields you asked for.

A .graphql file can contain schema definitions (the types and fields your API exposes), query documents (the data requests clients make), or both. The schema is a contract: it defines what's queryable, what types exist, and how they relate. Clients use the schema for autocompletion and validation before requests even leave the browser.

Facebook created GraphQL in 2012 and open-sourced it in 2015. GitHub, Shopify, and Stripe all offer GraphQL APIs. The ecosystem includes Apollo (client + server), Hasura (instant GraphQL on databases), and GraphiQL (an interactive query browser). VS Code with the GraphQL extension provides syntax highlighting and schema-aware autocompletion.

Technical details
Full Name
GraphQL Schema/Query
MIME Type
application/graphql
Developer
Facebook (now Meta)
Magic Bytes
N/A
Safety
.graphql is a known, safe format. Schema/query definition file. No executable content.
What opens it
VS Code (+ GraphQL extension)
FREE Windows / Mac / Linux
GraphiQL
FREE Web
Any text editor
FREE Windows / Mac / Linux
FAQ
Is GraphQL better than REST?
Neither is universally better. GraphQL excels when clients need flexible, nested data from multiple resources. REST is simpler for CRUD operations and caching. Many APIs use both — GraphQL for complex reads, REST for simple operations.
What's a GraphQL schema?
A type definition that describes your API's data model — what objects exist, what fields they have, how they relate, and what queries/mutations are available. It serves as both documentation and a contract.
Related formats