-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathscalars_input.ml
45 lines (42 loc) · 1.09 KB
/
scalars_input.ml
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
35
36
37
38
39
40
41
42
43
44
45
open Test_shared
module MyQuery =
[%graphql
{|
query ($arg: VariousScalarsInput!) {
scalarsInput(arg: $arg)
}
|}]
let includes_non_nulled_arguments () =
test_json_
(MyQuery.makeVariables
~arg:
{
nullableString = Some "a nullable string";
string = "a string";
nullableInt = Some 456;
int = 123;
nullableFloat = Some 567.5;
float = 1234.5;
nullableBoolean = Some false;
boolean = true;
nullableID = Some "a nullable ID";
id = "an ID";
}
()
|> MyQuery.serializeVariables |> MyQuery.variablesToJson)
(Json.Read.from_string
{| {
"arg": {
"nullableString": "a nullable string",
"string": "a string",
"nullableInt": 456,
"int": 123,
"nullableFloat": 567.5,
"float": 1234.5,
"nullableBoolean": false,
"boolean": true,
"nullableID": "a nullable ID",
"id": "an ID"
}
} |})
let tests = [ ("Includes non-nulled arguments", includes_non_nulled_arguments) ]