Converting GraphModel to POJO
fmoessle opened this issue · comments
Is there a way to convert the GraphModel from e.g. product.fetchAll() to a POJO?
I have issues with server-side rendering (nuxt), because the properties on e.g. a product are getter and not primitive values.
Hey @fmoessle I'm struggling with the same issue (nuxt), did you find a solution?
JSON.parse/JSON.stringify does the trick, but I feel bad for doing it
I imagine you ran into this problem while using nuxt3/vue3 and tried to use the GraphModel with reactive()?
Exactly. JSON.parse/JSON.stringify is my workaround for the moment too.
This works, but it leaves me with the problem that the @types/js-buy-sdk are completely outdated.
I also realized this in a quite painful way