Skip to content

Commit

Permalink
fix: add backticks around incorrect variable name
Browse files Browse the repository at this point in the history
"expected $this, got this" is confusing, so hopefully "expected $this, got `this`" helps
  • Loading branch information
lennyburdette committed Oct 17, 2024
1 parent c850e91 commit f667229
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apollo-federation/src/sources/connect/url_template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ impl FromStr for VariableType {
.find(|var_type| var_type.as_str() == input)
.ok_or_else(|| {
format!(
"Variable type must be one of {}, got {input}",
"Variable type must be one of {}, got `{input}`",
Self::iter().map(|var_type| var_type.as_str()).join(", ")
)
})
Expand Down Expand Up @@ -514,7 +514,7 @@ mod test_parse {
let err = URLTemplate::from_str("/something/{$blah.stuff}/more").unwrap_err();
assert_eq!(
err.message,
"Variable type must be one of $args, $this, $config, got $blah"
"Variable type must be one of $args, $this, $config, got `$blah`"
);
assert_eq!(err.location, Some(12..17));
}
Expand Down
2 changes: 1 addition & 1 deletion ...sources/connect/validation/snapshots/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ input_file: apollo-federation/src/sources/connect/validation/test_data/invalid-p
[
Message {
code: InvalidUrl,
message: "`GET` in `@connect(http:)` on `Query.resources` must be a valid URL template. Variable type must be one of $args, $this, $config, got $blah",
message: "`GET` in `@connect(http:)` on `Query.resources` must be a valid URL template. Variable type must be one of $args, $this, $config, got `$blah`",
locations: [
12:23..12:28,
],
Expand Down

0 comments on commit f667229

Please sign in to comment.