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