graphql-request icon indicating copy to clipboard operation
graphql-request copied to clipboard

Request Middleware doesn't accept async methods

Open salvatore-distefano opened this issue 2 years ago • 1 comments

Hey everyone!

I'm trying to implement a refresh-token strategy using the new middleware feature to request the new tokens if the token has expired.

To get the new token, I've to make a new request and wait for the result, but the new requestMiddleware() doesn't accept an async method.

Is planned in future to allow to return a Promise<…> and accept an async method, or to implement any new feature to allow to handle the refreshToken?

salvatore-distefano avatar Jul 22 '22 13:07 salvatore-distefano

Also would be a nice addition to support Promises

cjjenkinson avatar Jul 26 '22 21:07 cjjenkinson

Given the merge of https://github.com/prisma-labs/graphql-request/pull/379 is this still an issue?

Jacse avatar Nov 01 '22 13:11 Jacse

Given the merge of https://github.com/prisma-labs/graphql-request/pull/379 is this still an issue?

I think is canbe closed

shkreios avatar Dec 12 '22 10:12 shkreios