-
Notifications
You must be signed in to change notification settings - Fork 74
/
parameters.fsx
34 lines (28 loc) · 1.03 KB
/
parameters.fsx
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
// Uncomment those to use build script client assembly using netstandard2.0
//#r "../../bin/FSharp.Data.GraphQL.Shared/netstandard2.0/FSharp.Data.GraphQL.Shared.dll"
//#r "../../bin/FSharp.Data.GraphQL.Client/netstandard2.0/FSharp.Data.GraphQL.Client.dll"
//Uncomment those to use dotnet build command for the client assembly using netstandard2.0
#r "../../src/FSharp.Data.GraphQL.Shared/bin/Debug/netstandard2.0/FSharp.Data.GraphQL.Shared.dll"
#r "../../src/FSharp.Data.GraphQL.Client/bin/Debug/netstandard2.0/FSharp.Data.GraphQL.Client.dll"
open FSharp.Data.GraphQL
type MyProvider = GraphQLProvider<"http://localhost:8086">
let operation =
MyProvider.Operation<"""query q($id: String!) {
hero(id: $id) {
name
friends {
... on Human {
id
homePlanet
}
... on Droid {
id
primaryFunction
}
}
}
}""">
()
let result = operation.Run (id = "1000")
printfn "Result: %A" result.Data
printfn "Errors: %A" result.Errors