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

Guide: Mutation authorization #4956

Closed
batamire opened this issue May 16, 2024 · 2 comments
Closed

Guide: Mutation authorization #4956

batamire opened this issue May 16, 2024 · 2 comments

Comments

@batamire
Copy link

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 🙈

@rmosolgo
Copy link
Owner

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!

@batamire
Copy link
Author

⚡️🙌🏼

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

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