Redwood: Scaffold create and delete mutations don't update the UI

Created on 21 Oct 2020  路  5Comments  路  Source: redwoodjs/redwood

Re @cannikin, some of the scaffold's create and delete mutations don't update the UI anymore.

Create

create

This used to worked in ApolloClient v2 because of the cache-and-network fetch policy. But the cache-and-network fetch policy in v3 doesn't seem to be exactly the same, so we use cache-first now (which is also Apollo's default).

But since cache-first considers its job done as long as something's in the cache (even an empty array), the create mutation has to take care of updating the cache (it doesn't right now).

Delete

delete

Note that the delete button on the Posts page works because it specifies refetchQueries. So maybe we could just do that for the other ones too? That's what I thought, but it doesn't seem to be working. TBD.

Working on a fix now.

kinbug scaffold

All 5 comments

@jtoar Did you see this PR from Peter? https://github.com/redwoodjs/redwood/pull/1342

In Canary release only.

@thedavidprice Yeah I'm pretty sure that's just for updating an item using the edit button--apollo handles those kinds of mutations really well.

Ah, got it. I went through this too quickly the first time.

And, um, HOW HAS NO ONE ELSE REPORTED THIS YET 馃く

I think we're within 24 hour of trying to get v0.20 out. Are you working on this now? Would be fantastic to have it resolved. Thanks in advance!

I think @cannikin brought it up at the last meeting? That's why I started on this at least. Kind of hard to remember among all the apollo things going on :sweat_smile:.

But yeah I'll prioritize a fix in that time!

Fixed in #1387

Was this page helpful?
0 / 5 - 0 ratings

Related issues

josteph picture josteph  路  3Comments

CR1AT0RS picture CR1AT0RS  路  4Comments

peterp picture peterp  路  4Comments

freddydumont picture freddydumont  路  3Comments

thedavidprice picture thedavidprice  路  3Comments