laravel-graphql icon indicating copy to clipboard operation
laravel-graphql copied to clipboard

Add $context and $info to authorize method

Open bdebever opened this issue 7 years ago • 4 comments

I have added these 2 missing arguments in order to access the $info in the authorize method.

bdebever avatar Feb 04 '18 14:02 bdebever

Are there any issues with this PR? I'd like this added so I don't have to retrieve the extra arguments using func_get_args()

jradtilbrook avatar Jul 29 '18 12:07 jradtilbrook

I'd like this added so I don't have to retrieve the extra arguments using func_get_args()

IMHO technically it's not necessary. Did you try just added the arguments to authorize? You should still receive them. It's just the parent does not include them in the signature.

mfn avatar Jul 29 '18 18:07 mfn

I thought that originally as well and tested using it that way. However, with PHP7.2 at least, it resulted in a compile error because the signature no longer matched the parent and it threw an exception. So I am not able to do that until the parent signature is updated to what it should be.
Thanks for the suggestion though

jradtilbrook avatar Jul 29 '18 22:07 jradtilbrook

Uh, thanks for the heads up, wasn't aware of this 👍

mfn avatar Jul 30 '18 06:07 mfn