lib/graphql/schema/object.rb in graphql-1.9.21 vs lib/graphql/schema/object.rb in graphql-1.10.0.pre1

- old
+ new

@@ -33,16 +33,14 @@ # @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) - auth_val = context.query.with_error_handling do - begin - authorized?(object, context) - rescue GraphQL::UnauthorizedError => err - context.schema.unauthorized_object(err) - end + auth_val = begin + authorized?(object, context) + rescue GraphQL::UnauthorizedError => err + context.schema.unauthorized_object(err) end context.schema.after_lazy(auth_val) do |is_authorized| if is_authorized self.new(object, context) @@ -118,9 +116,10 @@ obj_type.name = graphql_name obj_type.description = description obj_type.interfaces = interfaces obj_type.introspection = introspection obj_type.mutation = mutation + obj_type.ast_node = ast_node fields.each do |field_name, field_inst| field_defn = field_inst.to_graphql obj_type.fields[field_defn.name] = field_defn end