R
Refine

ask-any-question

getIdentity

Sstuck-chocolate3/18/2023
Hi, is there a way we can update the state of our getIdentity, after updating a certain component belonging to our user, without fetching new data from the database? Is it better to use liveProvider? if so which provider would be best along with nodejs express backend?
Kkapa.ai3/18/2023
Hey @RomaY! I'm the kapa.ai support bot. I've searched through the docs to try to answer your question. :wave:
Kkapa.ai3/18/2023
---------------------- Based on the information provided in the extracts, the getIdentity method is used to get the user's identity and is called by the useGetIdentity hook. However, there is no direct way to update the state of getIdentity without fetching new data from the database. Regarding the liveProvider, it is used to add real-time support to your application, allowing you to update and show data in real-time throughout your app. You can use any real-time library or tool that you want with your Node.js Express backend. The liveProvider must have the following properties:
const liveProvider = {
subscribe: ({ channel, params: { ids }, types, callback }) => any,
unsubscribe: (subscription) => void,
publish?: (event) => void,
};
const liveProvider = {
subscribe: ({ channel, params: { ids }, types, callback }) => any,
unsubscribe: (subscription) => void,
publish?: (event) => void,
};
However, the liveProvider is more focused on real-time updates for data resources rather than updating the state of getIdentity. It might not be the best solution for your specific use case. For more information on liveProvider, you can refer to the Live / Realtime (https://refine.dev/docs/api-reference/core/providers/live-provider/#livemode) page and the Real-time support (https://refine.dev/blog/build-internal-tools-using-low-code-with-refine/#real-time-support) section in the blog post. ----------------------
Build internal tools using Low-Code with Refine, React-based framew...
Why you should be using low-code app Refine to build internal tools? Learn how to build low-code apps using Refine, React and Ant Design.
Kkapa.ai3/18/2023
<@538717491908575242> kapa.ai is still learning and improving, please let us how it did by reacting below
Hharsh-harlequin3/18/2023
Hey @RomaY you can update the query cache, the key of the useGetIdentity starts with getUserIdentity. You can also check the exact key through react query dev tools at the bottom right corner
Sstuck-chocolate3/18/2023
I am building a commercial web application, I wonder if there is a way to update certain data of our user (add/delete to/from favorites) or do I need to use liveProvider to query the database? So I'm adding data to my user, but I don't want to get my user again, is it possible to update my getIdentity on a successful request?
Vvariable-lime3/18/2023
getIdendity works through auth provider. refine liveProvider automatically updates only datasets running through the resoruce. So you should either invalidate the getIdenity request or use the refetch method.

Looking for more? Join the community!

R
Refine

ask-any-question

Join Server
Recommended Posts
inferencerHi how can we pass a custom json or typed object to the inferencer to scaffold crud operationsHow can I custom resource name in Notification when create or delete successHi guys. I want to change default resource name in Notification when create or delete success.502: Bad Gateway in directus exampleHere you have error https://refine.dev/docs/examples/data-provider/directus/ in sandbox.HeyHey I have recently raised an issue on UI i wanna work on that issue can anyone help me in how I caquery data cannot be undefinedI created a new Refine app, using the Remix framework and Headless components. I tried to implementUpgraded a new project to R4 Isn t goingUpgraded a new project to R4, Isn't going too good. Need to rewrite many things.Firebase Microsoft LoginHi everyone !! I'm new to Refine. I am trying to Implement Firebase signInWithEmailAndPassword and FUse json+ld data formatHi guys 👋 !! I'm new to refine. Actually i have a API which return me data in json+ld format and iHey Ömer 5479 have yet to upgrade to v4Hey @Omer, have yet to upgrade to v4 as we're now in the process of going live with the current versHey Ömer 5479 I have also upgraded toHey @Omer, I have also upgraded to refine v4 and transition was very smooth using codemod. Any issueMake api calls to a custom endpoint and not the resource nameHi all , I currently have 4 resources : users , roles , permissions , providers . I want to update rProvide a createbuttonprops resource name when I don't it on resources.I wan't to pass a create link for create button on List component, but I don't have that resource onSwapping out CRA with Vite after using CLIHello, I tried using the CLI to create a base with CRA using v4 of refine. I then tried to swap it oLogin or Logout not working with create refine-app supabase presetI made new project with `npm create refine-app@latest -- --preset refine-antd-supabase my-supabase-adeprecated LoginPage prop after migrated to Refine v4I have a custom LoginPage, in my app, after migrated to v4, the previous login page is working, but refect with pagination useListHi guys! can we use refecth with pagination in useList hook? i use strapi4 provider, but on strapi s