preauthorize doesn't default to expected values
lifeiscontent opened this issue · 4 comments
lifeiscontent commented
e.g.
I would expect preauthorize: { raise: false, with: PostPolicy }
to default to preauthorize: { to: :index?, raise: false, with: PostPolicy }
but it does not, in the README it states this is the expected behavior. So I guess this is a bug?
palkan commented
Default rule for preauthorize
depends on the field type. From the readme:
- for lists we use index?
- for singleton fields we use show?
lifeiscontent commented
@palkan so in my case, this is a list. could it be because the options hash has raise
in it?
palkan commented
No, it shouldn't.
Could you please show the GraphQL class?
lifeiscontent commented
@palkan sorry, it was because my type was not a list! My bad.