@@ -199,7 +199,7 @@ local function convert_record_fields_to_args(state, fields, opts)
199
199
200
200
--- @todo consider case when gql_class is wrapper nonNull around List
201
201
--- or Map
202
- if not ( is_for_args and (gql_class == ' List' or gql_class == ' Map' ) ) then
202
+ if ( not is_for_args ) or (gql_class ~= ' List' and gql_class ~= ' Map' ) then
203
203
args [field .name ] = nullable (gql_class )
204
204
end
205
205
end
@@ -235,8 +235,8 @@ local function convert_record_fields(state, fields, opts)
235
235
236
236
--- @todo consider case when gql_class is wrapper nonNull around List
237
237
--- or Map
238
- if not ( is_for_args and (res [field .name ].kind = = ' List'
239
- or res [field .name ].kind == ' Map' ) ) then
238
+ if ( not is_for_args ) or (res [field .name ].kind ~ = ' List'
239
+ and res [field .name ].kind ~= ' Map' ) then
240
240
object_args [field .name ] = nullable (res [field .name ].kind )
241
241
end
242
242
end
257
257
--- automatically generate corresponding decucible fields.
258
258
--- 2. The collection name will be used as the resulting graphql type name
259
259
--- instead of the avro-schema name.
260
+ ---
261
+ --- Resulting object will look like this:
262
+ ---
260
263
gql_type = function (state , avro_schema , collection , collection_name )
261
264
assert (type (state ) == ' table' ,
262
265
' state must be a table, got ' .. type (state ))
@@ -450,6 +453,7 @@ local function parse_cfg(cfg)
450
453
451
454
local fields = {}
452
455
456
+ -- create fields (from collections) for top-level gql type 'query)
453
457
for collection_name , collection in pairs (state .collections ) do
454
458
collection .name = collection_name
455
459
assert (collection .schema_name ~= nil ,
0 commit comments