Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Commit 5af08d8

Browse files
committed
move nullable back to tarantool_graphql from utils
1 parent 1377c75 commit 5af08d8

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

graphql/tarantool_graphql.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,16 @@ local function avro_type(avro_schema)
5757
error('unrecognized avro-schema type: ' .. json.encode(avro_schema))
5858
end
5959

60-
local nullable = utils.nullable
60+
-- XXX: recursive skip several NonNull's?
61+
local function nullable(gql_class)
62+
assert(type(gql_class) == 'table', 'gql_class must be a table, got ' ..
63+
type(gql_class))
64+
65+
if gql_class.__type ~= 'NonNull' then return gql_class end
66+
67+
assert(gql_class.ofType ~= nil, 'gql_class.ofType must not be nil')
68+
return gql_class.ofType
69+
end
6170

6271
local types_long = types.scalar({
6372
name = 'Long',

graphql/utils.lua

100644100755
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,4 @@ function utils.gen_booking_table(data)
132132
})
133133
end
134134

135-
-- XXX: recursive skip several NonNull's?
136-
function utils.nullable(gql_class)
137-
assert(type(gql_class) == 'table', 'gql_class must be a table, got ' ..
138-
type(gql_class))
139-
140-
if gql_class.__type ~= 'NonNull' then return gql_class end
141-
142-
assert(gql_class.ofType ~= nil, 'gql_class.ofType must not be nil')
143-
return gql_class.ofType
144-
end
145-
146-
147135
return utils

0 commit comments

Comments
 (0)