-
Notifications
You must be signed in to change notification settings - Fork 45
Error when using offlineMutate cache not updated #451
Comments
Hi There are actually two issues I see: As per docs update query field is Error printed to user is kinda bad so we going to change that. An additional issue is that automatic cache updates are designed to work with arguments in the root. When using single object in mutation additional mapping needs to be added like here: https://github.com/aerogear/datasync-starter/blob/master/client/src/config/clientConfig.ts#L98-L105 We need to document this. @darahayes @kingsleyzissou Do we have ability to define mapping per operation as well? |
Hi wtrocki Thanks for your reply
Thanks!!! |
Your query using obj as argument instead of variables:
offix is basing on concept that all arguments are put directly into mutation. |
i use angular & offix-angular and i get same error! wkLogout(id, logout): Promise { |
Ok. I will try to replicate this problem locally in the sample app and get back to you |
thanks a lot! I have another problem because my server uses hasura, and the mutation response fields is included in the returning (such as the following program snippet), this causing offix to fail to analyze。 wkLogon(login): Promise { |
Thanks a lot wtrocki for your reply ! |
I have managed to replicate the particular error messsage that @dioxapp is getting. you are getting the error because you are escaping the gql backticks: It should be:
Instead of this:
|
@eltonec I can see the returning object there after a mutation has been played. I am busy looking at the moment. The issue I see is that the returnType is not an address, but is an array. My understanding is that the input mapper in it's current state would not provide the correct update function for you. @wtrocki, maybe you could confirm? You could provide your own update function: It would look something like:
And the updateCache function would look something like:
You might have to play around with that, but that's more or less the idea. |
Hi, Thank you @kingsleyzissou the solution you proposed works!!!. Thanks ! |
Hey @dioxapp I’m glad that worked for you. I think it’s probably a similar issue to what eltonec was having in that it’s the way that hassura returns the data. You could write a custom update similar to the one I proposed for eltonec and that should work for the optimistic response |
Hi kingsleyzissou, It's what i did, i've create my own updatedCache method. By debuging i can see that it is called back when i get back online. Thanks |
@dioxapp apologies, I missed that. If the update function is only firing when you come back online, that seems to be a bug with the cache updates. We are busy looking to see how we can improve how we handle the cache with offline mutations at the moment and it is part of the roadmap for v1.0.0. I will try debug this on my end too |
Hi @dioxapp, we're busy doing some exciting changes to Offix and are actively looking at some solutions that would move us away from the cache and the cache updates and improve the overall developer experience. I haven't been able to reproduce this issue on my end. I'm closing this issue since it is unrelated to the initial one. If you are still having trouble with this, maybe you could create a new issue with some of the code you are using. |
Hello and thanks for the great library you made!!!
I am getting this error
![Offix_error](https://user-images.githubusercontent.com/65185835/81591939-82284280-93bd-11ea-8a68-7dc8f4964e31.PNG)
When i try to add a new record in my entity, ame issue for the delete statement :
But the database is well updated, its seems be a cache refresh issue...
Any help is appreciated !!!
Thanks
The text was updated successfully, but these errors were encountered: