.GQL file extension
To open .GQL files on Windows, right-click the .gql file → Open with → choose a text/code editor (any editor that can open plain text).
To open a .gql file, use a plain-text code editor (for example VS Code or any editor you already use). If you want syntax highlighting and validation, enable a GraphQL language plugin or GraphQL language service that recognizes the .gql extension.
Last updated: June 12, 2026
Open on your device
Choose your operating system for a dedicated step-by-step opening guide.
How to open .GQL files
Use these platform-specific instructions to open .GQL files safely.
Windows
- Right-click the .gql file → Open with → choose a text/code editor (any editor that can open plain text).
- If you want GraphQL syntax support, enable a GraphQL language plugin or language service in your editor and ensure it is configured to recognize the .gql extension.
Mac
- Control-click the .gql file → Open With → choose a text/code editor (any plain-text editor works).
- For completion/validation, enable GraphQL language tooling in your editor that supports .gql files.
Linux
- Open the .gql file in a text editor (e.g., your desktop’s default text editor or a code editor).
- If you use LSP-based tooling, configure/enable the GraphQL language service so .gql is treated as a GraphQL document.
iOS
- Open the .gql file in a text editor app that can display plain text; for full GraphQL tooling, transfer the file to a desktop editor with GraphQL language support.
Android
- Open the .gql file in a text editor app that can display plain text; for validation and schema-aware features, use a desktop code editor with GraphQL language tooling.
Security notes
- .gql files are plain text GraphQL documents, not executables; however, they can still drive sensitive data access when used as operations against a GraphQL endpoint (e.g., accidentally committing private queries or internal fragments).
- Be cautious when opening .gql files from untrusted sources in complex tooling (IDEs, language servers, code generators). While the file is text, parser or tooling vulnerabilities can be triggered by malformed input.
- If you use persisted queries or ship .gql files with an app, treat them as part of your API surface: avoid embedding secrets or assuming the document will remain private once distributed.
Before you run downloaded code
These files usually need a runtime (Python, Node, Java, …). They are not classic “file viruses,” but untrusted code can still do serious harm if you execute it. Prefer official packages, verify publishers, and scan archives or sketchy downloads when you are unsure.
Avast offers free and premium antivirus software that protects against viruses, malware, ransomware, and phishing. Scan files before opening them to ensure safety.
NortonNorton 360 delivers comprehensive antivirus protection, VPN, and identity theft monitoring. Scan files for threats before opening to keep your device secure.
We may earn a commission when you use affiliate links. This supports our free file extension guides.
Can't open this file?
These are the most common causes and fixes when .GQL files fail to open.
Common reasons
- The file opens as plain text with no GraphQL highlighting or validation
- Build or code generation tools ignore .gql files
- Requests fail at runtime because the .gql document is not valid for the server schema
Fix steps
- Install/enable GraphQL language tooling in your editor (GraphQL language service / plugin).
- Check the tool’s settings for recognized file extensions and confirm .gql is included.
OS-specific troubleshooting
What is a .GQL file?
A .gql file is usually a text file containing GraphQL document syntax (operations like query/mutation/subscription and reusable fragments). Tooling commonly treats .gql as interchangeable with other GraphQL document extensions, and editor language services often include .gql in their default supported extensions.
Background
GraphQL’s core language describes a text-based “Document” that can contain operations and fragments. In practice, teams often keep these documents in source control as separate files so that build tools, code generators, and IDE features (completion, validation, navigation) can process them.
Within the ecosystem, .gql is a common extension for these documents. For example, tooling examples show files like query.gql, and GraphQL language service tooling lists .gql among its default recognized GraphQL extensions.
Over HTTP, GraphQL operations are typically transported in JSON-based payloads, but saved query documents on disk are still plain text. If you are serving results over HTTP, note that GraphQL over HTTP defines a specific response media type for GraphQL responses.
Common MIME types: application/graphql-response+json
Known aliases: .graphql
Further reading
Authoritative resources for more details on the .GQL format.
- GraphQL Specification (GraphQL language and schema system)
- GraphQL Over HTTP (Draft) — response media type application/graphql-response+json
- apollo graphql-tag repository (examples using query.gql)
- IANA Media Types registry (authoritative MIME type registry)
- Shared MIME-info Database specification (how extensions map to MIME types on Linux desktops)
Common .GQL issues
The file opens as plain text with no GraphQL highlighting or validation
Many editors treat .gql as generic text unless GraphQL language tooling is installed or configured to include .gql as a recognized extension.
- Install/enable GraphQL language tooling in your editor (GraphQL language service / plugin).
- Check the tool’s settings for recognized file extensions and confirm .gql is included.
Build or code generation tools ignore .gql files
Some toolchains are configured to scan only certain extensions (often .graphql) for GraphQL documents.
- Check your tool’s configuration for included document globs/extensions and add *.gql if needed.
- If the tool cannot be configured, rename the file to an extension it scans (commonly .graphql) while keeping the content unchanged.
Requests fail at runtime because the .gql document is not valid for the server schema
A .gql file can be syntactically valid GraphQL but still fail against a specific schema (missing fields, wrong arguments, or fragment type mismatches).
- Validate the document using schema-aware tooling (GraphQL language service / IDE integration) against the correct schema.
- Update the operation/fragments to match the server schema and retry.
FAQ
Is a .gql file the same as .graphql?
In most tooling contexts, yes: both are used to store GraphQL documents (operations and fragments). Some tools default to one extension or the other, so you may need to adjust configuration or rename files.
Does .gql have an official MIME type?
The IANA media type registry is the authoritative place to check registrations. GraphQL over HTTP defines a media type for GraphQL responses: application/graphql-response+json.
What kind of content should be inside a .gql file?
Typically GraphQL operations (query, mutation, subscription) and fragments written in the GraphQL language defined by the GraphQL specification.
Similar file extensions
Compare related formats in the same category to find the right tool faster.