Skip to content

Commit 0f4072e

Browse files
committed
normalize reason text
1 parent 880ff44 commit 0f4072e

File tree

1 file changed

+7
-2
lines changed
  • crates/apollo-mcp-server/src/introspection

1 file changed

+7
-2
lines changed

crates/apollo-mcp-server/src/introspection/minify.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,20 @@ fn minify_directives(directives: &apollo_compiler::ast::DirectiveList) -> String
8383
for directive in directives.iter() {
8484
if let Some(minified_name) = directives_to_minify.get(directive.name.as_str()) {
8585
if !directive.arguments.is_empty() {
86-
// Since we're only handling @deprecated right now we can just add the reason and minify it
86+
// Since we're only handling @deprecated right now we can just add the reason and minify it.
87+
// We should handle this more generically in the future.
8788
let reason = directive
8889
.arguments
8990
.iter()
9091
.find(|a| a.name == "reason")
9192
.and_then(|a| a.value.as_str())
9293
.unwrap_or("No longer supported")
9394
.to_string();
94-
result.push_str(&format!("@{}(\"{}\")", minified_name, reason));
95+
result.push_str(&format!(
96+
"@{}(\"{}\")",
97+
minified_name,
98+
normalize_description(&reason)
99+
));
95100
} else {
96101
result.push_str(&format!("@{}", minified_name));
97102
}

0 commit comments

Comments
 (0)