Closed ebsangam closed 3 months ago
The repro does have non-public dependencies, I can't run it. It's also very big and has a lot of files and architecture. It also does not seem to actually use any type policies. Could you reproduce a more minimal example?
Or just show, with what data does the merge function get called, how do you merge them, and how does the exception get triggered?
Thank you for quick response. I will provide you minimal example.
I have pushed a new branch without local dependency. https://github.com/ebsangam/graphql_caching/tree/minimal-example This still has uses injectable/get_it for DI. I should run on you machine. Let me know if I need to remove injectable/get_it too.
What are the steps to reproduce the issue?
I have just updated the branch and removed all dependencies to third party packages that was not needed to reproduce the issue. https://github.com/ebsangam/graphql_caching/tree/minimal-example To reproduce:
PartialDataException
.Be sure to pull the latest changes.
@knaeckeKami also uncomment typePolicies
in /ferry/client.dart
. I missed to uncomment.
I can't seem to get it working. but I think you return a list of posts in your merge callback, when you should return a map that matches PostPage
Oh thanks. Solved. I am dumb to forget this when using dynamic types.
However we can make another ticket to make type policy type safe. It is too hard to work with dynamic types. What do you think?
you can create a ticket, but I don't see how fieldpolicies could be made typesafe.
Ok for now I am closing this issue. Thanks for your help.
I am trying to merge paginated result into the cache but it very difficult to implement and eventually it does not work. I am facing following issue and don't know how to solve.
TypePolicy
are not type safe. Everything is dynamic hence makes it difficult to implement.TypePolicy
, the merge function does not work as expected and it throwsPartialDataException
.After adding
ReadPolicy
it does solvePartialDataException
but throws type error as internally ferry tries to type cast a List of object as String.I have this example to reproduce the issue. https://github.com/ebsangam/graphql_caching