-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix for translation not working in graphql #17
Conversation
<plugin name="graphql_init_translations" | ||
type="ScandiPWA\CmsGraphQl\Plugin\InitGraphQlTranslations"/> | ||
</type> | ||
<type name="ScandiPWA\PersistedQuery\Plugin\PersistedQuery"> |
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.
is this actually necessary?
processRequest call in PersistedQuery is initiated by aroundDispatch method, so I assume that beforeDispatch plugin on the GraphQl controller would be enough
not 100% sure, perhaps an interaction with the around plugin makes it necessary, but please double check
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.
see minor comments
& thanks for porting this fix to core PWA
@@ -0,0 +1,93 @@ | |||
<?php | |||
/** | |||
* ScandiPWA_CmsGraphQl |
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.
personally, I'd put it in PersistedQuery module rather than CmsGraphQl, because it already has plugins on the GrapQL controller
9b3b3f6
to
bca0b87
Compare
@aleksandrsm Please check my changes and comments |
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.
Approved, but I still don't see the reason for plugin on ScandiPWA\PersistedQuery\Plugin\PersistedQuery - please double check that
So we need also this plugin to make translations work for all cases |
Odd, as Keep as is if it is necessary, and thanks for checking. |
This fixes the following Magento issue magento/magento2#31351
Some additional info https://stackoverflow.com/questions/61770306/while-working-with-the-magento-2-graphql-it-seems-that-the-string-translation-do