Implementing Mutex for GraphQL Requests with Effect and Token Refresh
Hey everyone! I'm trying to wrap this up into a mutex (which would be a semaphore with 1 permit), that way, if the request fails due to a
Can someone guide me through?
I can achieve this without Effect with
401, I call a refreshSession function to get the new access token, and retry the original mutation while queuing up all mutations (to ensure they are executed with a valid access token). I'm trying to wrap my head around how I can achieve this with Effect to no avail I can achieve this without Effect with
async-mutex with (pseudo-code) something like: