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

GraphQL: Allow returning a custom value for unauthorized fields

上级 2f67ce6e
No related branches found
No related tags found
无相关合并请求
...@@ -147,6 +147,12 @@ def parse_gids(global_ids, ctx = {}) ...@@ -147,6 +147,12 @@ def parse_gids(global_ids, ctx = {})
global_ids.map { |gid| parse_gid(gid, ctx) } global_ids.map { |gid| parse_gid(gid, ctx) }
end end
def unauthorized_field(error)
return error.field.if_unauthorized if error.field.respond_to?(:if_unauthorized) && error.field.if_unauthorized
super
end
private private
def max_query_complexity(ctx) def max_query_complexity(ctx)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册