forked from fsprojects/FSharp.Data.GraphQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphQLOptions.fs
More file actions
44 lines (33 loc) · 1.3 KB
/
GraphQLOptions.fs
File metadata and controls
44 lines (33 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
namespace FSharp.Data.GraphQL.Server.AspNetCore
open FSharp.Data.GraphQL
open System
open System.Text.Json
open System.Threading.Tasks
open Microsoft.AspNetCore.Http
type PingHandler = IServiceProvider -> JsonDocument voption -> Task<JsonDocument voption>
[<RequireQualifiedAccess>]
module GraphQLOptionsDefaults =
let [<Literal>] ReadBufferSize = 4096
let [<Literal>] WebSocketEndpoint = "/ws"
let [<Literal>] WebSocketConnectionInitTimeoutInMs = 3000.0
module GraphQLOptions =
let [<Literal>] IndentedOptionsName = "Indented"
type GraphQLTransportWSOptions = {
EndpointUrl : string
ConnectionInitTimeout : TimeSpan
CustomPingHandler : PingHandler voption
}
type IGraphQLOptions =
abstract member SerializerOptions : JsonSerializerOptions
abstract member WebsocketOptions : GraphQLTransportWSOptions
type GraphQLOptions<'Root> = {
mutable SchemaExecutor : Executor<'Root>
mutable RootFactory : HttpContext -> 'Root
/// The minimum rented array size to read a message from WebSocket
ReadBufferSize : int
SerializerOptions : JsonSerializerOptions
WebsocketOptions : GraphQLTransportWSOptions
} with
interface IGraphQLOptions with
member this.SerializerOptions = this.SerializerOptions
member this.WebsocketOptions = this.WebsocketOptions