mobxjs / mst-gql

Bindings for mobx-state-tree and GraphQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

generator crashes because of Apollo problems

dmytro-shpak opened this issue · 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 apollographql/federation#904

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

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...

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"

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.

Should be resolved as of 0.17.0.

confirm