graffle-js / graffle

Simple GraphQL Client for JavaScript. Minimal. Extensible. Type Safe. Runs everywhere.
http://graffle.js.org/
MIT License
5.85k stars 308 forks source link

graphql/printer not found #239

Closed amirHosseinKhademii closed 1 year ago

amirHosseinKhademii commented 3 years ago

when i compile my react app in typescript superset im getting an error saying that in graphql-request node nodules graphql/printer not found

EliasHjelm commented 3 years ago

I got this problem as well. After doing npm install --save-dev graphql the problem went away, at least for development build.

jjangga0214 commented 3 years ago

https://github.com/prisma-labs/graphql-request/blob/2c60842a84de120735661f71db827ec3c54ac962/package.json#L50-L52 https://github.com/prisma-labs/graphql-request/blob/2c60842a84de120735661f71db827ec3c54ac962/src/index.ts#L2

graphql is a peerDependency, and used in the source code. You have to install it as well.

@EliasHjelm The peerDependency is needed on runtime, not a development-only purpose. You should npm install --save graphql, not npm install --save-dev graphql.