草庐IT

previousQueryResult

全部标签

javascript - Apollo 客户端 : Upsert mutation only modifies cache on update but not on create

我有一个在创建或更新时触发的更新插入查询。在更新时,Apollo将结果集成到缓存中,但在创建时不会。这里是查询:exportconstUPSERT_NOTE_MUTATION=gql`mutationupsertNote($id:ID,$body:String){upsertNote(id:$id,body:$body){idbody}}`我的客户:constgraphqlClient=newApolloClient({networkInterface,reduxRootSelector:'apiStore',dataIdFromObject:({id})=>id});来自服务器的响应