Closed mwawrusch closed 2 years ago
Using: graphql_codegen: 0.10.3 json_serializable: 6.3.1
Output in flutter (please ignore the red markers)
{
"blocks":[
{
"__typename":"WalletContentBlockList",
"id":1,
"blockType":{
"id":"horizontal-scrolling-list",
"__typename":"WalletContentBlockType"
},
"caption":"Featured",
"items":[
{
"__typename":"WalletContentItemContentPreview",
"id":1,
"caption":MSO LAB Genesis #844,
"imageURL":"https"://lh3.googleusercontent.com/FCcSKSsYaNk9-bzks7ZWIEjFPiL8xrtb8aYnO2DG0piF9Eja1AkY55Yan-KQqtpcwISdpTWNz_W0yrmmmQM2hAHNG_AIXl7E4ATG2Q=w600,
"link":"https"://opensea.io/assets/ethereum/0xc2ac394984f3850027dac95fe8a62e446c5fb786/844
},
{
"__typename":"WalletContentItemContentPreview",
"id":2,
"caption":"The Outsiders Genesis",
"imageURL":"https"://lh3.googleusercontent.com/AM8EkaQl32uR8N1RIiJa5ogVG1gh2faX6u4a1TAa_NhsGkA2CRG0pFfMOOxcc09q2KFq5cQNljTFkDbbScWpUT70es83Di0RRWD7fjM=s0,
"link":"https":
},
{
"__typename":"WalletContentItemContentPreview",
"id":3,
"caption":Bored Ape Yacht Club #6386,
"imageURL":"https"://img.seadn.io/files/968a4be8ada4a55b59de561d15522b4e.png?fit=max&w=600,
"link":"https"://opensea.io/assets/ethereum/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/6386
}
]
},
{
"__typename":"WalletContentBlockList",
"id":2,
"blockType":{
"id":"vertical-short-list",
"__typename":"WalletContentBlockType"
},
"caption":"New",
"items":[
{
"__typename":"WalletContentItemContentPreview",
"id":1,
"caption":MSO LAB Genesis #844,
"imageURL":"https"://lh3.googleusercontent.com/FCcSKSsYaNk9-bzks7ZWIEjFPiL8xrtb8aYnO2DG0piF9Eja1AkY55Yan-KQqtpcwISdpTWNz_W0yrmmmQM2hAHNG_AIXl7E4ATG2Q=w600,
"link":"https"://opensea.io/assets/ethereum/0xc2ac394984f3850027dac95fe8a62e446c5fb786/844
},
{
"__typename":"WalletContentItemContentPreview",
"id":2,
"caption":"The Outsiders Genesis",
"imageURL":"https"://lh3.googleusercontent.com/AM8EkaQl32uR8N1RIiJa5ogVG1gh2faX6u4a1TAa_NhsGkA2CRG0pFfMOOxcc09q2KFq5cQNljTFkDbbScWpUT70es83Di0RRWD7fjM=s0,
"link":"https":
},
{
"__typename":"WalletContentItemContentPreview",
"id":3,
"caption":Bored Ape Yacht Club #6386,
"imageURL":"https"://img.seadn.io/files/968a4be8ada4a55b59de561d15522b4e.png?fit=max&w=600,
"link":"https"://opensea.io/assets/ethereum/0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d/6386
}
]
}
],
"__typename":"WalletGetContentPayload"
}
Thanks for reaching out with your problem. I've tried reproducing your issue here: https://github.com/heftapp/graphql_codegen/pull/169/files#diff-1069441418f33b6bf26dc7fbc305f8f1e06bfaf5b9494626cd4339684f8f95b3R89-R95 and as you can see the test passes which means that the data is identical after being de-serialzied and serialized again. This library is not copying stuff over. Instead, you should have a look at your client and the client cache setup.
Thx, seems that the problem happens before deserialization probably GraphQLClient (response.data contains the wrong values already).
Reposted it here: https://github.com/zino-hofmann/graphql-flutter/issues/1208
I have this schema:
with this sample payload
When deserialized in flutter the items from the second block are copied over the items of the first block.