How to load associations of the session context (or in general) and why? #110
Closed
Maciek Kucmus (mkucmus)
started this conversation in
Polls
Replies: 1 comment
-
|
Björn Meyer (@BrocksiNet) I think we've got a good input to proceed doing improvements in chosen areas ;) both scenarios are related to the core I guess and we should rather address it as an expected behavior. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently there is no way to associate linked entities and they remain
nullwithincontextresponse, called byrefreshSessionContextmethod ofuseSessionContextcomposable. Some of them are associated and present in the response, some of them not.context.salesChannel.languageis a good example, and it would be needed to get the current context's locale code for translations in the very beginning of app lifecycle. Language cannot be associated and is always nullish. The workaround is to get thelanguageIdfrom the context and call another endpoint/store-api/languagesto find corresponding one.little playground how it can work is here for this particular example: https://stackblitz.com/github/mkucmus/language-translations?file=app.vue
Pros of having associations for context endpoint:
Cons:
Based on the result I will or will not create a corresponding ticket for the Shopware 6 platform.
11 votes ·
Beta Was this translation helpful? Give feedback.
All reactions