rmosolgo/graphql-ruby

Guide: Mutation authorization

batamire opened this issue · 2 comments

Seems that mutation instance method #authorized? returning true, without call to super will not authorize arguments - as GraphQL::Schema::Resolver#authorized? will not be called. This is not specified in the docs?

Mutation class method .authorized? is a bit confusing, looks like it behaves something like #ready? instance method?

It is not very straightforward when to use super during authorization, at least for me 🙈

Hi, sorry for the confusion! Yes, authorized? should always call super for just the reasons that you found. I looked over the docs and updated some examples where it was missing in 6c53d49. Please let me know if you run into any more trouble with it!

⚡️🙌🏼

Could there be a way not to have to use super in authorizations? Feels too intimate with the underlying class. Just thinking out loud.