Skip to content

Commit ce72220

Browse files
committed
Added missing IndentedOptionsName constant
1 parent a32fa1e commit ce72220

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/FSharp.Data.GraphQL.Server.AspNetCore/GraphQLOptions.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ module GraphQLOptionsDefaults =
1515
let [<Literal>] WebSocketEndpoint = "/ws"
1616
let [<Literal>] WebSocketConnectionInitTimeoutInMs = 3000
1717

18+
module GraphQLOptions =
19+
20+
let [<Literal>] IndentedOptionsName = "Indented"
21+
1822
type GraphQLTransportWSOptions = {
1923
EndpointUrl : string
2024
ConnectionInitTimeout : TimeSpan

src/FSharp.Data.GraphQL.Server.AspNetCore/StartupExtensions.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module ServiceCollectionExtensions =
7676
member this.Create name = (getOptions sp)
7777
}
7878
)
79-
.Configure<GraphQLOptions<'Root>>(IndentedOptionsName, (fun o -> o.SerializerOptions.WriteIndented <- true))
79+
.Configure<GraphQLOptions<'Root>>(GraphQLOptions.IndentedOptionsName, (fun o -> o.SerializerOptions.WriteIndented <- true))
8080
.AddSingleton<IOptionsFactory<IGraphQLOptions>>(fun sp ->
8181
{ new IOptionsFactory<IGraphQLOptions> with
8282
member this.Create name =

src/FSharp.Data.GraphQL.Server.Giraffe/HttpHandlers.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ module HttpHandlers =
4545
let toResponse { DocumentId = documentId; Content = content; Metadata = metadata } =
4646

4747
let serializeIndented value =
48-
let jsonSerializerOptions = options.Get(IndentedOptionsName).SerializerOptions
48+
let jsonSerializerOptions = options.Get(GraphQLOptions.IndentedOptionsName).SerializerOptions
4949
JsonSerializer.Serialize (value, jsonSerializerOptions)
5050

5151
match content with

src/FSharp.Data.GraphQL.Server.Oxpecker/HttpEndpoints.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ namespace FSharp.Data.GraphQL.Server.AspNetCore.Giraffe
22

33
open System
44
open System.IO
5+
open System.Runtime.InteropServices
56
open System.Text.Json
67
open System.Text.Json.Serialization
78
open System.Threading.Tasks
@@ -17,7 +18,6 @@ open FSharp.Data.GraphQL
1718
open FSharp.Data.GraphQL.Ast
1819
open FSharp.Data.GraphQL.Server
1920
open FSharp.Data.GraphQL.Server.AspNetCore
20-
open System.Runtime.InteropServices
2121

2222
module HttpEndpoints =
2323

@@ -38,7 +38,7 @@ module HttpEndpoints =
3838
let toResponse { DocumentId = documentId; Content = content; Metadata = metadata } =
3939

4040
let serializeIndented value =
41-
let jsonSerializerOptions = options.Get(IndentedOptionsName).SerializerOptions
41+
let jsonSerializerOptions = options.Get(GraphQLOptions.IndentedOptionsName).SerializerOptions
4242
JsonSerializer.Serialize(value, jsonSerializerOptions)
4343

4444
match content with

0 commit comments

Comments
 (0)