Does not support generic types
anarandjic opened this issue · comments
If we have field that is referenced to different types of pages (article page, product page, landing page) I am not able to retreive reference by SanityReference type. Same is for blocks, if we have different types of blocks VideoBlock,TextBlock which are all derived from BaseBlock, I am no able to retreive different blocks under same type. My guess is that you should add typenamehandling serialization setting.
Hi,
If you use the JObject type you should be able to retrieve the data. Then
you can implement your own handler to convert to the respective types.
…On Friday, July 10, 2020, anarandjic ***@***.***> wrote:
If we have field that is referenced to different types of pages (article
page, product page, landing page) I am not able to retreive reference by
SanityReference type. Same is for blocks, if we have different types of
blocks VideoBlock,TextBlock which are all derived from BaseBlock, I am no
able to retreive different blocks under same type. My guess is that you
should add typenamehandling serialization setting.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#16>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOKFEMAQQVMYOMSPXKZ5TDR24NGRANCNFSM4OWTY2MA>
.
Thanks for advice, I will try but my guess is that this will solve issue.