|
6 | 6 | --- * GraphQL top level statement must be a collection name. Arguments for this
|
7 | 7 | --- statement match non-deducible field names of corresponding object and
|
8 | 8 | --- passed to an accessor function in the filter argument.
|
| 9 | +--- |
| 10 | +--- Border cases: |
| 11 | +--- |
| 12 | +--- * Unions: as GraphQL specification says "...no fields may be queried on |
| 13 | +--- Union type without the use of typed fragments." Tarantool_graphql |
| 14 | +--- behaves this way. So 'common fields' are not supported. This does NOT work: |
| 15 | +--- |
| 16 | +--- hero { |
| 17 | +-- hero_id -- common field |
| 18 | +-- ... on human { |
| 19 | +-- name |
| 20 | +-- } |
| 21 | +-- ... on droid { |
| 22 | +-- model |
| 23 | +-- } |
| 24 | +-- } |
| 25 | +--- (GraphQL spec: http://facebook.github.io/graphql/October2016/#sec-Unions) |
| 26 | +--- Also, no arguments are currently allowed for fragments. |
| 27 | +--- See issue about this (https://github.com/facebook/graphql/issues/204) |
| 28 | +--- |
9 | 29 |
|
10 | 30 | local json = require('json')
|
11 | 31 | local yaml = require('yaml')
|
@@ -359,7 +379,7 @@ local convert_simple_connection = function(state, connection, collection_name)
|
359 | 379 | 'connection.destination_collection must be a string, got ' ..
|
360 | 380 | type(c.destination_collection))
|
361 | 381 | assert(type(c.parts) == 'table',
|
362 |
| - 'connection.parts must be a string, got ' .. type(c.parts)) |
| 382 | + 'connection.parts must be a table, got ' .. type(c.parts)) |
363 | 383 |
|
364 | 384 | -- gql type of connection field
|
365 | 385 | local destination_type =
|
@@ -549,7 +569,7 @@ local convert_union_connection = function(state, connection, collection_name)
|
549 | 569 | ('only 1:1* or 1:N connections can have ' ..
|
550 | 570 | 'all key parts null; parent is %s from ' ..
|
551 | 571 | 'collection "%s"'):format(json.encode(parent),
|
552 |
| - tostring(collection_name))) |
| 572 | + tostring(collection_name))) |
553 | 573 | end
|
554 | 574 | return c.type == '1:N' and {} or nil
|
555 | 575 | end
|
|
0 commit comments