-
Notifications
You must be signed in to change notification settings - Fork 222
Changes setup of expression language functions to fix issue #588 #697
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This look good to me. Thank you @sgehrig !
LGTM too. I've made couple of changes in the master tho, so that |
Thanks you @sgehrig for fixing this annoying issue 👍🏻 |
Any chance to do a new release for 0.13.3? Oh, and thanks for merging the PR so quick. |
done @sgehrig ! Thanks again for the fix! |
As mentioned in comment #588 (comment) the true problem behind issue #588 is that the setup of the expression language functions is flawed. The expression language functions are not designed to take services as constructor arguments. Instead they must rely on dependencies passed into the function during execution.
This PR fixes these issues with several expression language functions. Instead of passing dependencies to the constructor (from where they were injected into closures), the evaluators no rely on the
'globalVariable'
in the$arguments
parameter - just as the compiler relies on$globalVariable
variable in the execution context.'globalVariable'
just points to an instance ofOverblog\GraphQLBundle\Definition\GlobalVariables
(again just the same as for complied function execution).Because all of the expression language functions are auto-wired and because the evaluator is only used directly in
Overblog\GraphQLBundle\Validator\Constraints\ExpressionValidator
, there has only been a slight service configuration change (the servicevalidator.expression
(instance ofOverblog\GraphQLBundle\Validator\Constraints\ExpressionValidator
) now also requires theOverblog\GraphQLBundle\Definition\GlobalVariables
service as its second constructor argument.