Created
December 4, 2020 10:42
-
-
Save xperiandri/be28b68c76142f04926b795fbdb73a54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Root (serviceProvider : IServiceProvider, | |
user : Lazy<Result<GraphQLUser, ErrorMessage>>, | |
facebookService : Lazy<Result<IFacebookService, ErrorMessage>>, | |
securityOptions : IOptions<SecurityOptions>) = | |
let securityOptions = securityOptions.Value | |
member val RequestId = System.Guid.NewGuid () with get | |
member __.ServiceProvider : IServiceProvider = serviceProvider | |
member __.UserResult : Result<GraphQLUser, ErrorMessage> = user.Value | |
member __.BibliotekoDatabase = serviceProvider.GetRequiredService<CosmosBibliotekoDatabase>() | |
// static var RootType = Define.Object<Root>(...) | |
let RootType = | |
Define.Object<Root> | |
(name = "Root", description = "The Root type to be passed to all our resolvers.", | |
isTypeOf = (fun o -> o :? Root), | |
fields = | |
[ Define.Field("requestId", Guid, "Id of the request.", (fun _ (r : Root) -> r.RequestId)) ]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment