lib/graphql/schema/object.rb in graphql-2.0.17.2 vs lib/graphql/schema/object.rb in graphql-2.0.18
- old
+ new
@@ -46,13 +46,11 @@
# @param object [Object] The thing wrapped by this object
# @param context [GraphQL::Query::Context]
# @return [GraphQL::Schema::Object, GraphQL::Execution::Lazy]
# @raise [GraphQL::UnauthorizedError] if the user-provided hook returns `false`
def authorized_new(object, context)
- trace_payload = { context: context, type: self, object: object, path: context[:current_path] }
-
- maybe_lazy_auth_val = context.query.trace("authorized", trace_payload) do
+ maybe_lazy_auth_val = context.query.current_trace.authorized(query: context.query, type: self, object: object) do
begin
authorized?(object, context)
rescue GraphQL::UnauthorizedError => err
context.schema.unauthorized_object(err)
rescue StandardError => err
@@ -60,10 +58,10 @@
end
end
auth_val = if context.schema.lazy?(maybe_lazy_auth_val)
GraphQL::Execution::Lazy.new do
- context.query.trace("authorized_lazy", trace_payload) do
+ context.query.current_trace.authorized_lazy(query: context.query, type: self, object: object) do
context.schema.sync_lazy(maybe_lazy_auth_val)
end
end
else
maybe_lazy_auth_val