You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plugin developers often load data such as data sources, dashboards, etc. This is currently achieved by using Grafana API. The issue is that mutations from plugins or Grafana do not automatically synchronize cached data. We would like to have access to the cached data, including performing mutations such as:
starring a dashboard
changing data source configuration
...
What would you like to be added:
We would like a query/mutation hooks package that would work similarly to popular data-fetching libraries such as RTKQ, React Query, SWR, etc.
fixedCacheKey (enable shared results across hook instances)
trigger: (function that triggers the mutation)
result:
data
error
isLoading
Note that we already use a generated client for the grafana API; this can be used by plugins right now. However, the cache is not updated when a mutation occurs in Grafana as it doesn't use this package.
Thanks for creating this @jarben!
One particular issue that we often face is that we sometimes update/delete some dashboards from the Connections plugin, and show a LinkButton to users which redirects them to their dashboards, and when they go there they don't see the latest state of dashboards if they have visited the dashboards page before, because the it is cached in Grafana. It would be nice if we could invalidate this cache from the plugin. See also #77959
Why is this needed:
Plugin developers often load data such as data sources, dashboards, etc. This is currently achieved by using Grafana API. The issue is that mutations from plugins or Grafana do not automatically synchronize cached data. We would like to have access to the cached data, including performing mutations such as:
What would you like to be added:
We would like a query/mutation hooks package that would work similarly to popular data-fetching libraries such as RTKQ, React Query, SWR, etc.
See this documentation for the full RTKQ query hook signature.
Note that we don't necessarily need full RTKQ implementation; a bare minimum would be:
options:
result:
See this documentation for the full RTKQ mutation hook signature
A bare minimum would be:
options:
result:
Note that we already use a generated client for the grafana API; this can be used by plugins right now. However, the cache is not updated when a mutation occurs in Grafana as it doesn't use this package.
Who is this feature for?
Plugin developers
cc @leventebalogh
The text was updated successfully, but these errors were encountered: