graphql_rails icon indicating copy to clipboard operation
graphql_rails copied to clipboard

"render" in before_action should prevent other actions

Open povilasjurcys opened this issue 2 years ago • 0 comments

class SomeConrtoller < GraphqlRails::Controller
  before_action :render_error
  action(:my_action).returns('String')
 
  def my_action
    puts "my action"
  end

  def render_error
     render(errors: ['error'])
  end
end

this code renders ['error'] and also prints "my action".

I would expect only ['error'] without printing "my action"

povilasjurcys avatar Jun 28 '22 06:06 povilasjurcys