[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"extension:v3:en:gql":3},{"resolvedFromAlias":4,"canonicalExt":5,"ext":5,"name":6,"category":7,"categoryName":8,"updatedAt":9,"popularity":10,"summary":11,"howToOs":12,"quickAnswer":18,"answerIntro":19,"whatIs":20,"description":21,"furtherReading":22,"openInstructions":38,"commonIssues":52,"securityNotes":71,"faq":75,"aliases":85,"mimeTypes":87,"relatedExtensions":89,"breadcrumbs":137,"categoryAnchor":147,"categoryFuturePath":148,"metaDescription":149,"availableHowToOs":150,"openOnDeviceLinks":151,"cannotOpenReasons":167,"cannotOpenFixes":168,"convertOptions":169,"securityAffiliateMessaging":170,"securityAffiliates":171},false,"gql","GraphQL Document (operations and fragments)","code","Code","2026-06-12T09:10:36.454Z",55,".gql files typically store GraphQL query/mutation/subscription documents (and fragments) used by GraphQL clients, servers, and developer tools. You can open them in any text editor, and many GraphQL editor/LSP tools recognize .gql for syntax features.",[13,14,15,16,17],"windows","mac","linux","ios","android","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.","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.","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.\n\nWithin 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.\n\nOver 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.",[23,26,29,32,35],{"title":24,"url":25},"GraphQL Specification (GraphQL language and schema system)","https://github.com/graphql/graphql-spec",{"title":27,"url":28},"GraphQL Over HTTP (Draft) — response media type application/graphql-response+json","https://graphql.github.io/graphql-over-http/draft/",{"title":30,"url":31},"apollo graphql-tag repository (examples using query.gql)","https://github.com/apollographql/graphql-tag",{"title":33,"url":34},"IANA Media Types registry (authoritative MIME type registry)","https://www.iana.org/assignments/media-types/",{"title":36,"url":37},"Shared MIME-info Database specification (how extensions map to MIME types on Linux desktops)","https://apol.pages.freedesktop.org/xdg-specs/shared-mime-info-spec/shared-mime-info-spec-latest.html",{"windows":39,"macos":42,"linux":45,"ios":48,"android":50},[40,41],"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.",[43,44],"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.",[46,47],"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.",[49],"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.",[51],"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.",[53,59,65],{"title":54,"description":55,"steps":56},"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.",[57,58],"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.",{"title":60,"description":61,"steps":62},"Build or code generation tools ignore .gql files","Some toolchains are configured to scan only certain extensions (often .graphql) for GraphQL documents.",[63,64],"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.",{"title":66,"description":67,"steps":68},"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).",[69,70],"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.",[72,73,74],".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.",[76,79,82],{"question":77,"answer":78},"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.",{"question":80,"answer":81},"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.",{"question":83,"answer":84},"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.",[86],"graphql",[88],"application/graphql-response+json",[90,96,101,107,113,119,125,131],{"ext":91,"name":92,"category":7,"categoryName":8,"popularity":93,"summary":94,"howToOs":95},"php","PHP script (PHP source code)",85,".php files typically contain PHP source code used on web servers to generate dynamic web pages and API responses. You can open them in a code editor, but they are usually executed by a web server (often via PHP-FPM) rather than “run” like a normal desktop app.",[13,14,15,16,17],{"ext":97,"name":98,"category":7,"categoryName":8,"popularity":93,"summary":99,"howToOs":100},"sql","SQL script (Structured Query Language)",".sql files contain SQL statements (queries, schema definitions, and data changes) that can be run by a database tool or opened as plain text for review and editing.",[13,14,15,16,17],{"ext":102,"name":103,"category":7,"categoryName":8,"popularity":104,"summary":105,"howToOs":106},"cs","C# source code file",80,".cs files contain C# source code used to build .NET applications and libraries. They are plain-text files typically edited in code editors and IDEs such as Visual Studio Code with C# tooling.",[13,14,15,16,17],{"ext":108,"name":109,"category":7,"categoryName":8,"popularity":110,"summary":111,"howToOs":112},"go","Go source file",78,".go files contain source code written in the Go (Golang) programming language. You can open them in code editors (for reading/editing) or build/run them with the Go toolchain.",[13,14,15,16,17],{"ext":114,"name":115,"category":7,"categoryName":8,"popularity":116,"summary":117,"howToOs":118},"tsx","TypeScript JSX (TSX) source file",75,".tsx is a TypeScript source code file that contains JSX syntax, commonly used with React-style UI components. You open it in a code editor (for viewing/editing) and build it with TypeScript tooling (for running in apps).",[13,14,15,16,17],{"ext":120,"name":121,"category":7,"categoryName":8,"popularity":122,"summary":123,"howToOs":124},"kt","Kotlin source file",72,".kt files contain Kotlin source code used to build Kotlin applications (including Android apps) and libraries. You typically open them in a code editor or IDE such as IntelliJ IDEA or Android Studio.",[13,14,15,16,17],{"ext":126,"name":127,"category":7,"categoryName":8,"popularity":128,"summary":129,"howToOs":130},"swift","Swift Source Code",70,".swift is a Swift programming language source file used to write apps and other software. You open it in code editors and IDEs such as Xcode or other text/code editors.",[13,14,15,16,17],{"ext":132,"name":133,"category":7,"categoryName":8,"popularity":134,"summary":135,"howToOs":136},"dart","Dart source code",65,".dart files contain source code written in the Dart programming language. You open them in a code editor/IDE or work with them using the Dart SDK tools.",[13,14,15,16,17],[138,141,144],{"label":139,"to":140},"Home","/",{"label":142,"to":143},"File Extension Index","/file-extension",{"label":145,"to":146},".GQL","/file-extension/gql","category-code","/category/code","Learn what .GQL files are, how to open them on every platform, common fixes, and security best practices.",[13,14,15,16,17],[152,155,158,161,164],{"os":13,"label":153,"to":154},"Open .GQL on Windows","/how-to/open-gql-on-windows",{"os":14,"label":156,"to":157},"Open .GQL on Mac","/how-to/open-gql-on-mac",{"os":15,"label":159,"to":160},"Open .GQL on Linux","/how-to/open-gql-on-linux",{"os":16,"label":162,"to":163},"Open .GQL on iOS","/how-to/open-gql-on-ios",{"os":17,"label":165,"to":166},"Open .GQL on Android","/how-to/open-gql-on-android",[54,60,66],[57,58],[],"code_runtime",[172,176],{"name":173,"description":174,"affiliateUrl":175},"Avast","Avast offers free and premium antivirus software that protects against viruses, malware, ransomware, and phishing. Scan files before opening them to ensure safety.","https://www.avast.com/lp-aff-consumer-store?expid=inf601",{"name":177,"description":178,"affiliateUrl":179},"Norton","Norton 360 delivers comprehensive antivirus protection, VPN, and identity theft monitoring. Scan files for threats before opening to keep your device secure.","http://buy.norton.com/aff_home?utm_campaign=en-ww_nor_n36_aff_nas_nau_nah_cj_nad_low:_sec_nat_mktc_norton_360"]