jasonkuhrt / graphql-request

Minimal GraphQL client
MIT License
5.77k stars 307 forks source link

TypeScript doesn't recognize the types and fail v7 #844

Closed AbdUlHamedMaree closed 2 months ago

AbdUlHamedMaree commented 2 months ago

Screenshot

image image

Description

after upgrading to version 7, TypeScript compiler and all related tools to it seems to not be able to read the declaration files from the bundle anymore, I found the files in my node_modules but I think that TSC isn't going to read the exports field with that nested deep object to get the types,

My expo application is failing and I can be sure that other tools relaying on TSC will fail as well.

Reproduction Steps/Repo Link

just install v7 of this lib in a repo that uses TSC.

jasonkuhrt commented 2 months ago

You need to setup TS to read from package.exports. Duplicate of https://github.com/jasonkuhrt/graphql-request/issues/841 and others before.