From e2dbe1a9507d92b178095e8ce131767c37e53cf0 Mon Sep 17 00:00:00 2001 From: ChuanWeis Date: Wed, 13 May 2026 09:04:04 +0800 Subject: [PATCH] fix(cli): detect graphql files in run attachments --- src/cortex-cli/src/run_cmd/mime.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cortex-cli/src/run_cmd/mime.rs b/src/cortex-cli/src/run_cmd/mime.rs index 37f1cc90d..51fd9a8b5 100644 --- a/src/cortex-cli/src/run_cmd/mime.rs +++ b/src/cortex-cli/src/run_cmd/mime.rs @@ -34,6 +34,7 @@ pub fn mime_type_from_extension(path: &Path) -> String { "ps1" => "text/x-powershell", "yaml" | "yml" => "text/yaml", "toml" => "text/toml", + "graphql" | "gql" => "application/graphql", // Images "png" => "image/png", @@ -75,6 +76,14 @@ mod tests { mime_type_from_extension(&PathBuf::from("test.json")), "application/json" ); + assert_eq!( + mime_type_from_extension(&PathBuf::from("schema.graphql")), + "application/graphql" + ); + assert_eq!( + mime_type_from_extension(&PathBuf::from("query.gql")), + "application/graphql" + ); assert_eq!( mime_type_from_extension(&PathBuf::from("test.png")), "image/png"