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

`requestMiddleware` does not have a supported type that can be exported (`RequestExtendedInit`)

Open rcwestlake opened this issue 2 years ago • 3 comments

When defining middleware, I cannot get access to the correct type RequestExtendedInit. I think RequestExtendedInit should be able to be exported.

export declare type RequestMiddleware<V extends Variables = Variables> = (request: RequestExtendedInit<V>) => RequestExtendedInit | Promise<RequestExtendedInit>;

image image

rcwestlake avatar Dec 20 '22 00:12 rcwestlake

Have you found a temporary workaround for this perhaps?

Edit: For now creating the middleware function as an arrow function does the job.

image

volt-99-dev avatar Jan 10 '23 12:01 volt-99-dev

I encountered the same problem: RequestExtendedInit type is not exported. For now I use any as a type for my middleware's request.

image

rocketana avatar Jan 20 '23 02:01 rocketana

Same issue for me with version 5.1.0. Reverted to 5.0.

boardofchris avatar Feb 07 '23 03:02 boardofchris