mst-gql icon indicating copy to clipboard operation
mst-gql copied to clipboard

generator crashes because of Apollo problems

Open dmytro-shpak opened this issue 2 years ago • 5 comments

Can not generate code for schema

npm -v

8.1.0

node -v

v16.13.0

 npx mst-gql "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3"

Error: Cannot find module 'graphql/validation/rules/KnownArgumentNamesRule' Require stack:

Looks like the problem is related to https://github.com/apollographql/federation/issues/904

dmytro-shpak avatar May 24 '22 19:05 dmytro-shpak

now after switch to yarn and playing with global installation and combining of grapgql and apollo packages versions it works for me. I do not know yet what is a minimal package.json configuration

dmytro-shpak avatar May 26 '22 15:05 dmytro-shpak

The mst-gql dependencies are a mess. The only way to use mst-gql with npm (for me) was to install it with --force. But then every time I used npm install I had to use --force which had an impact on other packages as well... In the end, I've switched to yarn (it wasn't that bad when using NX) but this is not possible for every project :/ I guess this goes under the radar because contributors are using yarn and simply don't see the issues on the other side of the fence. I keep wondering though if what yarn does when installing mst-gql is safe...

krstns avatar May 30 '22 09:05 krstns

ok, like a workaround for me works yarn and

        "apollo": "^2.34.0",
        "graphql": "15.8.0",
        "graphql-request": "^4.2.0",
        "mobx": "^6.6.0",
        "mobx-react-lite": "^3.4.0",
        "mobx-router": "^1.0.0",
        "mobx-state-tree": "^5.1.5",
        "mst-gql": "^0.15.0",
        "react": "^18.1.0",
        "react-dom": "^18.1.0"

dmytro-shpak avatar Jun 05 '22 21:06 dmytro-shpak

Hey @dmytro-shpak, 0.16.0 will be out soon with a fix for this and other bugs. I'm working on upgrading/replacing dependencies right now.

jesse-savary avatar Jun 10 '22 20:06 jesse-savary

Should be resolved as of 0.17.0.

jesse-savary avatar Jul 19 '22 03:07 jesse-savary

confirm

dmytro-shpak avatar Nov 07 '22 10:11 dmytro-shpak