|
| 1 | +/// <summary> |
| 2 | +/// Compilation-only tests that verify all public AddGraphQL overloads resolve correctly. |
| 3 | +/// These functions are never called at runtime. |
| 4 | +/// </summary> |
| 5 | +module FSharp.Data.GraphQL.IntegrationTests.Server.ServiceCollectionExtensionsCompilationTests |
| 6 | + |
| 7 | +open System |
| 8 | +open Microsoft.AspNetCore.Http |
| 9 | +open Microsoft.Extensions.DependencyInjection |
| 10 | + |
| 11 | +open FSharp.Data.GraphQL |
| 12 | +open FSharp.Data.GraphQL.Server.AspNetCore |
| 13 | +open FSharp.Data.GraphQL.Samples.StarWarsApi |
| 14 | + |
| 15 | +let private rootFactory (ctx : HttpContext) : Root = Root(ctx) |
| 16 | + |
| 17 | +let private probe_ExecutorInstance_Handler_NoOptionals () = |
| 18 | + let services = ServiceCollection() :> IServiceCollection |
| 19 | + services.AddGraphQL<Root, DefaultGraphQLRequestHandler<Root>>(Schema.executor, rootFactory) |> ignore |
| 20 | + |
| 21 | +let private probe_ExecutorInstance_Handler_WithWsPath () = |
| 22 | + let services = ServiceCollection() :> IServiceCollection |
| 23 | + services.AddGraphQL<Root, DefaultGraphQLRequestHandler<Root>>(Schema.executor, rootFactory, "/ws") |> ignore |
| 24 | + |
| 25 | +let private probe_ExecutorInstance_Handler_WithConfigure () = |
| 26 | + let services = ServiceCollection() :> IServiceCollection |
| 27 | + let configure = Func<GraphQLOptions<Root>, GraphQLOptions<Root>>(id) |
| 28 | + services.AddGraphQL<Root, DefaultGraphQLRequestHandler<Root>>(Schema.executor, rootFactory, configure) |> ignore |
| 29 | + |
| 30 | +let private probe_ExecutorInstance_NoHandler_NoOptionals () = |
| 31 | + let services = ServiceCollection() :> IServiceCollection |
| 32 | + services.AddGraphQL<Root>(Schema.executor, rootFactory) |> ignore |
| 33 | + |
| 34 | +let private probe_ExecutorInstance_NoHandler_WithWsPath () = |
| 35 | + let services = ServiceCollection() :> IServiceCollection |
| 36 | + services.AddGraphQL<Root>(Schema.executor, rootFactory, "/ws") |> ignore |
| 37 | + |
| 38 | +let private probe_ExecutorInstance_NoHandler_WithConfigure () = |
| 39 | + let services = ServiceCollection() :> IServiceCollection |
| 40 | + let configure = Func<GraphQLOptions<Root>, GraphQLOptions<Root>>(id) |
| 41 | + services.AddGraphQL<Root>(Schema.executor, rootFactory, configure) |> ignore |
| 42 | + |
| 43 | +let private probe_FromDI_Handler_WithWsPath () = |
| 44 | + let services = ServiceCollection() :> IServiceCollection |
| 45 | + services.AddGraphQL<Root, DefaultGraphQLRequestHandler<Root>>(rootFactory, "/ws") |> ignore |
| 46 | + |
| 47 | +let private probe_FromDI_Handler_NoOptionals () = |
| 48 | + let services = ServiceCollection() :> IServiceCollection |
| 49 | + services.AddGraphQL<Root, DefaultGraphQLRequestHandler<Root>>(rootFactory) |> ignore |
| 50 | + |
| 51 | +let private probe_FromDI_Handler_WithConfigure () = |
| 52 | + let services = ServiceCollection() :> IServiceCollection |
| 53 | + let configure = Func<GraphQLOptions<Root>, GraphQLOptions<Root>>(id) |
| 54 | + services.AddGraphQL<Root, DefaultGraphQLRequestHandler<Root>>(rootFactory, configure) |> ignore |
| 55 | + |
| 56 | +let private probe_FromDI_NoHandler_WithWsPath () = |
| 57 | + let services = ServiceCollection() :> IServiceCollection |
| 58 | + services.AddGraphQL<Root>(rootFactory, "/ws") |> ignore |
| 59 | + |
| 60 | +let private probe_FromDI_NoHandler_NoOptionals () = |
| 61 | + let services = ServiceCollection() :> IServiceCollection |
| 62 | + services.AddGraphQL<Root>(rootFactory) |> ignore |
| 63 | + |
| 64 | +let private probe_FromDI_NoHandler_WithConfigure () = |
| 65 | + let services = ServiceCollection() :> IServiceCollection |
| 66 | + let configure = Func<GraphQLOptions<Root>, GraphQLOptions<Root>>(id) |
| 67 | + services.AddGraphQL<Root>(rootFactory, configure) |> ignore |
| 68 | + |
| 69 | + |
0 commit comments