Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not call method with key args inside extra_attribute/attribute block #455

Open
yanghoxom opened this issue Oct 17, 2023 · 3 comments
Open

Comments

@yanghoxom
Copy link

yanghoxom commented Oct 17, 2023

Behavior

I cannot call the helper method if it contains the key in args inside the extra_attribute or attribute block
If I edit the method to not contain the key in the args, everything works fine
example:


module AHelper
  def b_method(text, date:)
  end

  def c_method(text, date)
  end
end

class AResource < ApplicationResource
  include AHelper
  extra_attribute :attr_test, :array do
    b_method('123', date: Date.new) # throw error
    c_method('123', Date.new) # work normally
  end

  def base_scope
    b_method('123', date: Date.new) # work normally
    c_method('123', Date.new) # work normally
    super
  end
end

Gem

Ruby 3.1.3
Rails 7.0.4

    graphiti (1.3.9)
      activesupport (>= 5.2)
      concurrent-ruby (~> 1.0)
      dry-types (>= 0.15.0, < 2.0)
      graphiti_errors (~> 1.1.0)
      jsonapi-renderer (~> 0.2, >= 0.2.2)
      jsonapi-serializable (~> 0.3.0)
    graphiti-rails (0.4.0)
      graphiti (~> 1.2)
      railties (>= 5.0)
      rescue_registry (~> 1.0)
    graphiti_errors (1.1.2)
      jsonapi-serializable (~> 0.1)
    graphiti_spec_helpers (1.1.0)
      graphiti (>= 1.0.alpha.1)
      rspec (~> 3.0)

Server log

wrong number of arguments (given 2, expected 1; required keyword: date)
/home/hung/test_project/app/helpers/a_helper.rb:100:in `b_method': wrong number of arguments (given 2, expected 1; required keyword: date) (ArgumentError)
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/serializer.rb:76:in `method_missing'
        from /home/hung/test_project/app/resources/a_resource.rb:39:in `block in <class:TeamHistoryResource>'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/util/serializer_attributes.rb:138:in `instance_eval'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/util/serializer_attributes.rb:138:in `block in wrap_proc'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/hash_renderer.rb:33:in `instance_eval'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/hash_renderer.rb:33:in `block (2 levels) in to_hash'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/hash_renderer.rb:31:in `each'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/hash_renderer.rb:31:in `each_with_object'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/hash_renderer.rb:31:in `block in to_hash'
        from <internal:kernel>:90:in `tap'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/hash_renderer.rb:4:in `to_hash'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/hash_renderer.rb:175:in `get_nodes'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/hash_renderer.rb:146:in `render'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/jsonapi-serializable-0.3.1/lib/jsonapi/serializable/renderer.rb:47:in `render'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/renderer.rb:71:in `block in render'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti.rb:65:in `block in broadcast'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/notifications.rb:206:in `block in instrument'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/notifications.rb:206:in `instrument'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti.rb:64:in `broadcast'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/renderer.rb:58:in `render'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/renderer.rb:33:in `as_json'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/renderer.rb:29:in `to_json'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/resource_proxy.rb:47:in `to_json'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/active_model_serializers/serializable_resource.rb:10:in `to_json'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/active_model_serializers/logging.rb:71:in `block (3 levels) in notify'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/active_model_serializers/logging.rb:24:in `block (3 levels) in instrument_rendering'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/active_model_serializers/logging.rb:81:in `block in notify_render'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/notifications.rb:206:in `block in instrument'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/notifications.rb:206:in `instrument'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/active_model_serializers/logging.rb:80:in `notify_render'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/active_model_serializers/logging.rb:23:in `block (2 levels) in instrument_rendering'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/active_model_serializers/logging.rb:97:in `block in tag_logger'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb:99:in `block in tagged'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb:37:in `tagged'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb:99:in `tagged'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/active_model_serializers/logging.rb:97:in `tag_logger'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/active_model_serializers/logging.rb:22:in `block in instrument_rendering'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:127:in `instance_exec'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:138:in `run_callbacks'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/active_model_serializers/logging.rb:70:in `block (2 levels) in notify'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/renderers.rb:156:in `block in <module:Renderers>'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/active_model_serializers-0.10.13/lib/action_controller/serialization.rb:72:in `block (2 levels) in <module:Serialization>'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/renderers.rb:149:in `block in _render_to_body_with_renderer'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/3.1.0/set.rb:511:in `each_key'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/3.1.0/set.rb:511:in `each'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/renderers.rb:145:in `_render_to_body_with_renderer'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/renderers.rb:141:in `render_to_body'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/abstract_controller/rendering.rb:25:in `render'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/rendering.rb:30:in `render'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/instrumentation.rb:22:in `block (2 levels) in render'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/benchmark-0.2.1/lib/benchmark.rb:311:in `realtime'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/core_ext/benchmark.rb:14:in `ms'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/instrumentation.rb:22:in `block in render'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/instrumentation.rb:91:in `cleanup_view_runtime'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/searchkick-4.5.0/lib/searchkick/logging.rb:217:in `cleanup_view_runtime'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/railties/controller_runtime.rb:34:in `cleanup_view_runtime'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/instrumentation.rb:21:in `render'
        from /home/hung/test_project/app/controllers/api/v2/admin/setting/team_histories_controller.rb:12:in `show'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/basic_implicit_render.rb:6:in `send_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/abstract_controller/base.rb:215:in `process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/rendering.rb:53:in `process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/abstract_controller/callbacks.rb:234:in `block in process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:118:in `block in run_callbacks'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/react-rails-2.6.2/lib/react/rails/controller_lifecycle.rb:31:in `use_react_component_helper'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-rails-0.4.0/lib/graphiti/rails/debugging.rb:13:in `block in debug_graphiti'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti/debugger.rb:110:in `debug'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-rails-0.4.0/lib/graphiti/rails/debugging.rb:12:in `debug_graphiti'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-rails-0.4.0/lib/graphiti/rails/context.rb:17:in `block in wrap_graphiti_context'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-1.3.9/lib/graphiti.rb:33:in `with_context'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/graphiti-rails-0.4.0/lib/graphiti/rails/context.rb:16:in `wrap_graphiti_context'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:127:in `block in run_callbacks'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:138:in `run_callbacks'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/abstract_controller/callbacks.rb:233:in `process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/rescue.rb:22:in `process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/instrumentation.rb:67:in `block in process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/notifications.rb:206:in `block in instrument'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/notifications.rb:206:in `instrument'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/instrumentation.rb:66:in `process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal/params_wrapper.rb:259:in `process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rescue_registry-1.0.0/lib/rescue_registry/controller.rb:24:in `process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/searchkick-4.5.0/lib/searchkick/logging.rb:212:in `process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/railties/controller_runtime.rb:27:in `process_action'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/abstract_controller/base.rb:151:in `process'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionview-7.0.4/lib/action_view/rendering.rb:39:in `process'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal.rb:188:in `dispatch'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_controller/metal.rb:251:in `dispatch'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/routing/route_set.rb:32:in `serve'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/journey/router.rb:50:in `block in serve'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/journey/router.rb:32:in `each'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/journey/router.rb:32:in `serve'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/routing/route_set.rb:852:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/omniauth-2.1.0/lib/omniauth/strategy.rb:202:in `call!'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/omniauth-2.1.0/lib/omniauth/strategy.rb:169:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/bullet-7.0.4/lib/bullet/rack.rb:15:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/warden-1.2.9/lib/warden/manager.rb:36:in `block in call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `catch'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/warden-1.2.9/lib/warden/manager.rb:34:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/tempfile_reaper.rb:15:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/etag.rb:27:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/conditional_get.rb:27:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/head.rb:12:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/http/permissions_policy.rb:38:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/http/content_security_policy.rb:36:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/session/abstract/id.rb:266:in `context'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/session/abstract/id.rb:260:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/cookies.rb:696:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration.rb:603:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/callbacks.rb:99:in `run_callbacks'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/callbacks.rb:26:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/executor.rb:14:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/better_errors-2.9.1/lib/better_errors/middleware.rb:87:in `protected_app_call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/better_errors-2.9.1/lib/better_errors/middleware.rb:82:in `better_errors_call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/better_errors-2.9.1/lib/better_errors/middleware.rb:60:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/debug_exceptions.rb:28:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/show_exceptions.rb:26:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rescue_registry-1.0.0/lib/rescue_registry/action_dispatch/show_exceptions.rb:11:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rescue_registry-1.0.0/lib/rescue_registry/reset_context.rb:9:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/rack/logger.rb:40:in `call_app'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/rack/logger.rb:25:in `block in call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb:99:in `block in tagged'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb:37:in `tagged'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/tagged_logging.rb:99:in `tagged'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/rack/logger.rb:25:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/quiet_assets.rb:13:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/remote_ip.rb:93:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/request_store-1.5.1/lib/request_store/middleware.rb:19:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/request_id.rb:26:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/method_override.rb:24:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/runtime.rb:22:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activesupport-7.0.4/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/executor.rb:14:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/static.rb:23:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/sendfile.rb:110:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/actionpack-7.0.4/lib/action_dispatch/middleware/host_authorization.rb:137:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-mini-profiler-3.0.0/lib/mini_profiler/profiler.rb:393:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/webpacker-5.4.3/lib/webpacker/dev_server_proxy.rb:25:in `perform_request'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-proxy-0.7.4/lib/rack/proxy.rb:78:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/railties-7.0.4/lib/rails/engine.rb:530:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-brotli-1.2.0/lib/rack/brotli/deflater.rb:34:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/rack-2.2.4/lib/rack/deflater.rb:44:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/puma-6.0.1/lib/puma/configuration.rb:268:in `call'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/puma-6.0.1/lib/puma/request.rb:93:in `block in handle_request'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/puma-6.0.1/lib/puma/thread_pool.rb:340:in `with_force_shutdown'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/puma-6.0.1/lib/puma/request.rb:92:in `handle_request'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/puma-6.0.1/lib/puma/server.rb:429:in `process_client'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/puma-6.0.1/lib/puma/server.rb:232:in `block in run'
        from /home/hung/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/puma-6.0.1/lib/puma/thread_pool.rb:147:in `block in spawn_thread'
@TafadzwaD
Copy link

@yanghoxom Experienced the same issue after upgrading to Graphiti 1.3.9. This fixes the issue ab08388

@yanghoxom
Copy link
Author

@TafadzwaD thank you for your reply, Can you give me more details about how to fix it?

@TafadzwaD
Copy link

TafadzwaD commented Oct 19, 2023

@TafadzwaD thank you for your reply, Can you give me more details about how to fix it?

@yanghoxom
You can use the forked version https://github.com/belt/graphiti_resources_ruby_3_0_fix/tree/fix_ruby_3_0_resource_functions in you gem file
gem 'graphiti', github: 'belt/graphiti_resources_ruby_3_0_fix', branch: 'fix_ruby_3_0_resource_functions'

After the PR is merged you can then revert to the official version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants