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
I am trying to use apollo-link-token-refresh in a typescript project. In this project, we are using a library function to make the access token refresh request, and that library function does not expose the Fetch API underneath:
I believe I should be able to use apollo-link-token-refresh without casting to any or using any other type hacks. Perhaps TokenRefreshLink should have an optional type parameter.
Hi, @amacleay, did you try to do something like this?:
accessTokenField: 'refreshedSession',// Your object name with `accessToken` and // `expirationTimestamp` that returned by fetchfetchAccessToken: fetch(...),handleResponse: (_,__)=>(response: typeYouNeed)=>{
...
return{accessToken,
expirationTimestamp
};},
handleFetch: ({ accessToken, expirationTimestamp })=>saveToken
That would certainly work as I've laid out the issue.
In actual fact, though, I need to use a function in fetchAccessToken that doesn't expose the fetch API at all: my refreshSession function is actually wrapping a call to apollo-client
I am trying to use apollo-link-token-refresh in a typescript project. In this project, we are using a library function to make the access token refresh request, and that library function does not expose the
Fetch
API underneath:I believe I should be able to use apollo-link-token-refresh without casting to
any
or using any other type hacks. Perhaps TokenRefreshLink should have an optional type parameter.Workaround: force my session response to be of a modified
Response
type:The text was updated successfully, but these errors were encountered: