Skip to content

Commit

Permalink
missing GraphQL value escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
Husqvik committed Feb 4, 2023
1 parent e5e1c14 commit 913a369
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/GraphQlClientGenerator/BaseClasses.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ value is IFormattable formattable
if (value is short || value is ushort || value is byte || value is int || value is uint || value is long || value is ulong || value is float || value is double || value is decimal)
return Convert.ToString(value, CultureInfo.InvariantCulture);

var argumentValue = Convert.ToString(value, CultureInfo.InvariantCulture);
var argumentValue = EscapeGraphQlStringValue(Convert.ToString(value, CultureInfo.InvariantCulture));
return $"\"{argumentValue}\"";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace GraphQlGenerator.Test
if (value is short || value is ushort || value is byte || value is int || value is uint || value is long || value is ulong || value is float || value is double || value is decimal)
return Convert.ToString(value, CultureInfo.InvariantCulture);

var argumentValue = Convert.ToString(value, CultureInfo.InvariantCulture);
var argumentValue = EscapeGraphQlStringValue(Convert.ToString(value, CultureInfo.InvariantCulture));
return $"\"{argumentValue}\"";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace SourceGeneratorTestAssembly
if (value is short || value is ushort || value is byte || value is int || value is uint || value is long || value is ulong || value is float || value is double || value is decimal)
return Convert.ToString(value, CultureInfo.InvariantCulture);

var argumentValue = Convert.ToString(value, CultureInfo.InvariantCulture);
var argumentValue = EscapeGraphQlStringValue(Convert.ToString(value, CultureInfo.InvariantCulture));
return $"\"{argumentValue}\"";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ internal static class GraphQlQueryHelper
if (value is short || value is ushort || value is byte || value is int || value is uint || value is long || value is ulong || value is float || value is double || value is decimal)
return Convert.ToString(value, CultureInfo.InvariantCulture);

var argumentValue = Convert.ToString(value, CultureInfo.InvariantCulture);
var argumentValue = EscapeGraphQlStringValue(Convert.ToString(value, CultureInfo.InvariantCulture));
return $"\"{argumentValue}\"";
}

Expand Down

0 comments on commit 913a369

Please sign in to comment.