Skip to content

Commit d3acfb5

Browse files
fix: expand variables in graphql
1 parent 314aa24 commit d3acfb5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lua/rest-nvim/parser/init.lua

+2
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ function parser.parse_body(content_type, body_node, source, context)
139139
elseif node_type == "graphql_body" then
140140
body.__TYPE = "graphql"
141141
local query_text = vim.treesitter.get_node_text(assert(body_node:named_child(0)), source)
142+
query_text = expand_variables(query_text, context)
142143
local variables_text
143144
local variables_node = body_node:named_child(1)
144145
if variables_node then
145146
variables_text = vim.treesitter.get_node_text(variables_node, source)
147+
variables_text = expand_variables(variables_text, context)
146148
end
147149
body.data = vim.json.encode({
148150
query = query_text,

0 commit comments

Comments
 (0)