When a specific error occurs I want to send an fetch request or mutation and after the request fullfillled then retry operation in onError link

Hi , I want to refresh my jwt cookie whenever server send back unauthenticated error , because of the jwt cookie expired . After that error response come back to errorLink I want to send another mutation or fetch request to server for refresh auth cookie , then when that refresh requests response come back (fullfilled) to error link then retry the first query or mutation.I dont use token on local storage i just want to use http only cookie . Cokkie works fine but my problem is just refresh logic. I couldnt implement that. Any suggest or sample code about that problem ? Thank you.