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

"Exports is not defined" error in version >= 3

Open SofianeDjellouli opened this issue 3 years ago • 1 comments

Hi,

I have a exports is not defined error when importing from graphql-request in version higher than 3. I'm now using version 2.0.0 to make it work. My project is compiled using Webpack and served on the browser.

SofianeDjellouli avatar Jan 26 '22 08:01 SofianeDjellouli

I had a similar problem when using @graphql-codegen/typescript-graphql-request because the generated code tried to import the types with import * ... instead of import type * ...

Adding to useTypeImports: true to my graphql.config.yml solved the problem for me.

icalvin102 avatar Aug 02 '22 14:08 icalvin102