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

Re-export FetchError type

Open leumasme opened this issue 3 years ago • 0 comments

GraphQLClient.request may throw a FetchError from node-fetch. In order to nicely catch this type in typescript, the fetch error type is needed. This type is inaccessible through graphql-request, so separately adding node-fetch to the dependencies just to import the Error type is required (or alternatively copy-pasting the error type definition into the project) This isn't good usability, so i believe graphql-request typedefinitions should re-export the FetchError type. Thanks

leumasme avatar Feb 24 '22 23:02 leumasme