-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathmutations.fsx
29 lines (23 loc) · 1.07 KB
/
mutations.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
// 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<"""mutation m {
setMoon (id: "1", isMoon: true) {
id
name
isMoon
}
}""">
()
let result = operation.Run ()
// Mutations are also supported.
// Subscriptions are not fully supported at the moment.
// Only direct responses will be received - we don't have a socket base connection.
printfn "Mutation result: %A\n" result.Data
printfn "Mutation errors: %A\n" result.Errors