Skip to content

Expose a way to update query cache for custom data provider methods #10990

@jvasseur

Description

@jvasseur

Is your feature request related to a problem? Please describe.

When calling custom RPC methods like described in https://marmelab.com/react-admin/Actions.html#calling-custom-methods, if you want to update the query cache like it is done in the built-in useUpdate hooks you have to either copy most of what the updateCache function is doing into your code or force a complete refresh of the ressource.

Describe the solution you'd like

I would like a method to update the query cache without having to trigger a full refresh. The simplest solution is probably to expose the updateCache feature as a public API (maybe a useUpdateCache hook).

Another solution could be to allow overriding the data provider method that is called by the useUpdate hook but that requires that the method returns the data in the correct format and it wouldn't cover the case where a mutation update multiple entities at the same time.

I'm willing to spend some time working of the solution if it's something that you are willing to add to the core.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions