@@ -47,6 +47,44 @@ GraphQL queries on data from the local Tarantool's storage called spaces.
47
47
It is planned to implement another data accessor that allows to fetch objects
48
48
sharded using tarantool/shard module.
49
49
50
+ ### Notes on types
51
+
52
+ User should distinguish between Object and Map types. Both of them consists of
53
+ keys and values but there are some important differences.
54
+
55
+ While Object is a GraphQL built-in type, Map is a scalar-based type. In case of
56
+ Object-based type all key-value pairs are set during type definition and values
57
+ may have different types (as defined in the schema).
58
+
59
+ In contrast, set of valid Map keys is not defined in the schema, any key-value
60
+ pair is valid despite name of the key while value has schema-determined type
61
+ (which is the same among all values in the map).
62
+
63
+ Map-based types should be queried as a scalar type, not as an object type
64
+ (because map's keys are not part of the schema).
65
+
66
+ The following example works:
67
+
68
+ ```
69
+ {
70
+ …
71
+ map_based_type
72
+ …
73
+ }
74
+ ```
75
+
76
+ The following example doesn't work:
77
+
78
+ ```
79
+ {
80
+ …
81
+ map_based_type {
82
+ key_1
83
+ }
84
+ …
85
+ }
86
+ ```
87
+
50
88
## Run tests
51
89
52
90
```
@@ -57,7 +95,7 @@ make test
57
95
58
96
## Requirements
59
97
60
- * For use: tarantool, lulpeg, >=tarantool/shard-1.1-91-gfa88bf8 (optional),
98
+ * For use: tarantool, lulpeg, >=tarantool/shard-1.1-91-gfa88bf8 (optional),
61
99
tarantool/avro-schema.
62
100
* For test (additionally to 'for use'): python 2.7, virtualenv, luacheck.
63
101
* For building apidoc (additionally to 'for use'): ldoc.
0 commit comments