palkan / action_policy-graphql

Action Policy integration for GraphQL
MIT License
152 stars 9 forks source link

Modules reloading works incorrectly in development #38

Closed rzaharenkov closed 3 years ago

rzaharenkov commented 3 years ago

It works as expected in production (with enabled eager loading). But I'm having difficulties in development when I change any file in app/graphql it starts to fail with the following error:

error: "NoMethodError"
message: "undefined method `expose_authorization_rules' for Types::ResourceType:Class"

Tell us about your environment

Ruby Version: 2.6.6

Framework Version (Rails, whatever): 5.2

Action Policy Version: 0.5.1

Action Policy GraphQL Version: 0.5.3

What did you do?

Changing code in app/graphql while running rails server in development mode.

What did you expect to happen?

Method expose_authorization_rules can be used to expose resource authentication rules.

What actually happened?

Getting NoMethodError exception.

palkan commented 3 years ago

Released in 0.5.2.