-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathGraphQLProvider.DesignTime.fs
More file actions
34 lines (27 loc) · 1.25 KB
/
GraphQLProvider.DesignTime.fs
File metadata and controls
34 lines (27 loc) · 1.25 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
// The MIT License (MIT)
// Copyright (c) 2016 Bazinga Technologies Inc
namespace FSharp.Data.GraphQL.Client
open System.Reflection
open FSharp.Core.CompilerServices
open ProviderImplementation.ProvidedTypes
open FSharp.Data.GraphQL
[<TypeProvider>]
type GraphQLTypeProvider (config) as this =
inherit TypeProviderForNamespaces(config,
assemblyReplacementMap = [
"FSharp.Data.GraphQL.Client.DesignTime", "FSharp.Data.GraphQL.Client"
"FSharp.Data.GraphQL.Shared", "FSharp.Data.GraphQL.Shared"
],
addDefaultProbingLocation = true)
let ns = "FSharp.Data.GraphQL"
let asm = Assembly.GetExecutingAssembly()
do this.AddNamespace(ns, [Provider.makeProvidedType(asm, ns, config.ResolutionFolder)])
override this.ResolveAssembly args =
if args.Name.Contains("FSharp.Data.GraphQL") then
printfn "ResolveAssembly: %s" args.Name
config.ReferencedAssemblies
|> Array.filter _.Contains("FSharp.Data")
|> Array.iter (fun x -> printfn "%s" x)
base.ResolveAssembly args
[<assembly:TypeProviderAssembly>]
do()