graphprotocol / graph-client

The Graph library for building GraphQL-based dapps in a decentralized way.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: args.schema.getRootType is not a function after running The Graph Client DevTools

schmidsi opened this issue · comments

I'm trying to use the simplest setup of Graph Client to just query my local Graph Node. When I runpnpm graphclient serve-dev and run any query in the exposed GraphiQL interface, I receive the following error:

{
  "errors": [
    {
      "message": "args.schema.getRootType is not a function"
    }
  ]
}

Steps to reproduce

You need to have docker installed and running

Not sure if related but if I try to query through Graph Client I see the following warning in the browser:

../node_modules/.pnpm/@graphql-mesh+utils@0.41.20_frfeqt5y6urghbnh4docfsx6zy/node_modules/@graphql-mesh/utils/index.mjs
Critical dependency: the request of a dependency is an expression hot-dev-client.js:85:24
../node_modules/.pnpm/@graphql-tools+url-loader@7.16.4_otuvekqdquydy6klgbn7fidsmy/node_modules/@graphql-tools/url-loader/esm/index.js
Critical dependency: the request of a dependency is an expression

Could you try with the latest versions? Thanks!
Also could you create a minimal example on CodeSandbox please becauze I had some issues while running the remote API?

Or here as the standalone repo: https://github.com/schmidsi/graph-client-bug-

You can go in there, install dependencies and then run the dev server:

pnpm install
pnpm graphclient build
pnpm graphclient serve-dev

And run an arbitrary query in the dev GraphiQL like:

query MyQuery {
  traits {
    name
    numberOfNfts
  }
}

To reproduce. Happend to me on CodeSandbox and isolated env on my machine.

It seems you're using an old version of GraphQL js. Could you update graphql to the latest and try again?

Interesting, updating to "graphql": "^16.6.0", did the trick. Thanks for the help!