You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm stuck on a use case, and am looking for help. I'm using a graphql api that I don't want to modify (directus) and in some cases, the list of elements (here posts) is nested in a sub-element (here "post_id", see fromJson in the WrappedConverter2).
This code works, but I have to have a converter every time I have a list of items, which isn't ideal because I have to do a lot of copy-and-paste code, which is bad practice.
I've made several attempts to make my converter generic, but unfortunately when I use genericity it doesn't work with freezed, or it's probably me who can't get it right.
Does anyone have a good way to have a single JsonConverter or some other solution that I can apply to all my objects that have sublists of this type?
Hello,
I'm stuck on a use case, and am looking for help. I'm using a graphql api that I don't want to modify (directus) and in some cases, the list of elements (here posts) is nested in a sub-element (here "post_id", see fromJson in the WrappedConverter2).
This code works, but I have to have a converter every time I have a list of items, which isn't ideal because I have to do a lot of copy-and-paste code, which is bad practice.
I've made several attempts to make my converter generic, but unfortunately when I use genericity it doesn't work with freezed, or it's probably me who can't get it right.
Does anyone have a good way to have a single JsonConverter or some other solution that I can apply to all my objects that have sublists of this type?
The idea would be to have something like
The text was updated successfully, but these errors were encountered: