NOTE: Set your network to devnet in your subgraph.yaml file manually. It will not be listed in the graph init command because mevm is not yet supported by thegraph.
Your subgraph.yaml should look something like this:
Note: Replace the <PROJECT>/<NAME> accordingly. Example lync/nfts
You can use this endpoint to query your subgraph data using graphql.
Troubleshooting
If while deploying the subgraph you face any errors like:
x graph create --node <https://api.mevm-devnet.lync.world/deploy> lync/nfts
› Warning: In next major version, this command will be merged as a subcommand for `graph local`.
✖ HTTP error creating the subgraph: 480
/home/tit4n/.nvm/versions/node/v20.14.0/lib/node_modules/@graphprotocol/graph-cli/node_modules/@oclif/core/lib/errors/index.js:21
throw new exit_2.ExitError(code);
^
ExitError: EEXIT: 1
at Object.exit (/home/tit4n/.nvm/versions/node/v20.14.0/lib/node_modules/@graphprotocol/graph-cli/node_modules/@oclif/core/lib/errors/index.js:21:11)
at CreateCommand.exit (/home/tit4n/.nvm/versions/node/v20.14.0/lib/node_modules/@graphprotocol/graph-cli/node_modules/@oclif/core/lib/command.js:131:23)
at /home/tit4n/.nvm/versions/node/v20.14.0/lib/node_modules/@graphprotocol/graph-cli/dist/commands/create.js:50:22
at Client._parseResponse (/home/tit4n/.nvm/versions/node/v20.14.0/lib/node_modules/@graphprotocol/graph-cli/node_modules/jayson/lib/client/index.js:190:12)
at /home/tit4n/.nvm/versions/node/v20.14.0/lib/node_modules/@graphprotocol/graph-cli/node_modules/jayson/lib/client/index.js:149:10
at IncomingMessage.<anonymous> (/home/tit4n/.nvm/versions/node/v20.14.0/lib/node_modules/@graphprotocol/graph-cli/node_modules/jayson/lib/client/http.js:80:11)
at IncomingMessage.emit (node:events:531:35)
at endReadableNT (node:internal/streams/readable:1696:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
oclif: { exit: 1 },
code: 'EEXIT'
}
Node.js v20.14.0
Here, take a look at the error code. 480 in the output above.
ERROR CODE
REASON
SOLUTION
401
Request Unauthorized
470
Naming format not followed properly
The name of the subgraph should be in the format <PROJECT>/<NAME>
480
Name already taken
Reuse of the subgraph name is not allowed. Use a different name.