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

Commit 589778a

Browse files
committed
add comments on gql queries assert and compile functions
1 parent 12700f6 commit 589778a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

graphql/tarantool_graphql.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ local function parse_cfg(cfg)
414414
return state
415415
end
416416

417+
--- The function checks if given query has an appropriate type
418+
--- (mutations are not supported yet)
417419
local function assert_gql_query_ast(func_name, ast)
418420
assert(#ast.definitions == 1,
419421
func_name .. ': expected an one query')
@@ -442,6 +444,8 @@ local function gql_execute(qstate, variables)
442444
operation_name)
443445
end
444446

447+
--- The function parses a raw query string, validate the resulting query
448+
--- and return it ready for execution
445449
local function gql_compile(state, query)
446450
assert(type(state) == 'table' and type(query) == 'string',
447451
'use :validate(...) instead of .validate(...)')

0 commit comments

Comments
 (0)