Skip to content
代码片段 群组 项目
未验证 提交 15741022 编辑于 作者: Heinrich Lee Yu's avatar Heinrich Lee Yu
浏览文件

Make GraphQL lookahead work for list types

上级 7c883d28
No related branches found
No related tags found
2 合并请求!3031Merge per-main-jh to main-jh by luzhiyuan,!3030Merge per-main-jh to main-jh
...@@ -67,6 +67,7 @@ def preloads_from_node_selection(selected_fields, fields) ...@@ -67,6 +67,7 @@ def preloads_from_node_selection(selected_fields, fields)
def node_selection(selection = lookahead) def node_selection(selection = lookahead)
return selection unless selection&.selected? return selection unless selection&.selected?
return selection if selection.field.type.list?
return selection.selection(:edges).selection(:node) if selection.selects?(:edges) return selection.selection(:edges).selection(:node) if selection.selects?(:edges)
# Will return a NullSelection object if :nodes is not a selection. This # Will return a NullSelection object if :nodes is not a selection. This
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
... on WorkItemWidgetDefinitionCustomFields { ... on WorkItemWidgetDefinitionCustomFields {
customFields { customFields {
id id
createdBy { name } selectOptions { value }
} }
} }
} }
......
...@@ -893,6 +893,7 @@ def positive_lookahead ...@@ -893,6 +893,7 @@ def positive_lookahead
allow(selection).to receive(:selection).and_return(selection) allow(selection).to receive(:selection).and_return(selection)
allow(selection).to receive(:selections).and_return(selection) allow(selection).to receive(:selections).and_return(selection)
allow(selection).to receive(:map).and_return(double(include?: true)) allow(selection).to receive(:map).and_return(double(include?: true))
allow(selection).to receive_message_chain(:field, :type, :list?).and_return(false)
end end
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册