Skip to content

Commit 86faa93

Browse files
Copilotxperiandri
andcommitted
Apply code review feedback: use uppercase hex for Unicode escapes and object initializer syntax
Agent-Logs-Url: https://github.com/fsprojects/FSharp.Data.GraphQL/sessions/ce0fba11-9043-452f-b948-e03c8b644f26 Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
1 parent 355d611 commit 86faa93

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/FSharp.Data.GraphQL.Shared/AstExtensions.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ type Document with
116116
| '\n' -> escaped.Append("\\n") |> ignore
117117
| '\r' -> escaped.Append("\\r") |> ignore
118118
| '\t' -> escaped.Append("\\t") |> ignore
119-
| c when c < '\u0020' -> escaped.AppendFormat("\\u{0:x4}", int c) |> ignore
119+
| c when c < '\u0020' -> escaped.AppendFormat("\\u{0:X4}", int c) |> ignore
120120
| c -> escaped.Append(c) |> ignore
121121
escaped.Append('"').ToString()
122122
let withQuotes = escapeGraphQLString

src/FSharp.Data.GraphQL.Shared/ValidationResultCache.fs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ module SchemaId =
2727
/// <param name="introspectionSchema">The introspection schema to hash.</param>
2828
/// <returns>A lowercase hexadecimal SHA-256 hash string that uniquely identifies the schema structure.</returns>
2929
let fromIntrospectionSchema (introspectionSchema : IntrospectionSchema) =
30-
let options = JsonSerializerOptions()
31-
options.WriteIndented <- false
32-
options.DefaultIgnoreCondition <- System.Text.Json.Serialization.JsonIgnoreCondition.Never
30+
let options = JsonSerializerOptions(
31+
WriteIndented = false,
32+
DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.Never
33+
)
3334
let json = JsonSerializer.Serialize(introspectionSchema, options)
3435
let jsonBytes = Encoding.UTF8.GetBytes json
3536
use sha256 = SHA256.Create()

0 commit comments

Comments
 (0)