Skip to content

Commit e2dbe1a

Browse files
committed
fix(cli): detect graphql files in run attachments
1 parent 7954d02 commit e2dbe1a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/cortex-cli/src/run_cmd/mime.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub fn mime_type_from_extension(path: &Path) -> String {
3434
"ps1" => "text/x-powershell",
3535
"yaml" | "yml" => "text/yaml",
3636
"toml" => "text/toml",
37+
"graphql" | "gql" => "application/graphql",
3738

3839
// Images
3940
"png" => "image/png",
@@ -75,6 +76,14 @@ mod tests {
7576
mime_type_from_extension(&PathBuf::from("test.json")),
7677
"application/json"
7778
);
79+
assert_eq!(
80+
mime_type_from_extension(&PathBuf::from("schema.graphql")),
81+
"application/graphql"
82+
);
83+
assert_eq!(
84+
mime_type_from_extension(&PathBuf::from("query.gql")),
85+
"application/graphql"
86+
);
7887
assert_eq!(
7988
mime_type_from_extension(&PathBuf::from("test.png")),
8089
"image/png"

0 commit comments

Comments
 (0)