graph-tooling icon indicating copy to clipboard operation
graph-tooling copied to clipboard

graph-cli failing to generate types for multi-dimensional arrays on graph init and graph add

Open itsjerryokolo opened this issue 1 year ago • 0 comments

Which packages are impacted by your issue?

@graphprotocol/graph-cli

Describe the issue

This subgraph is failing with the error below during initialisation.

✖ Failed to create subgraph scaffold: ',' expected. (3:41)
  1 |
  2 |   import { assert, describe, test, clearStore, beforeAll, afterAll } from "matchstick-as/assembly/index"
> 3 |   import { Bytes, Address, BigInt, Array<Bytes } from "@graphprotocol/graph-ts"
    |                                         ^
  4 |   import { AddNomineeHash } from "../generated/schema"
  5 |   import { AddNomineeHash as AddNomineeHashEvent } from "../generated/Contract/Contract"
  6 |   import { handleAddNomineeHash } from "../src/contract"
    SyntaxError: ',' expected. (3:41)
      1 |
      2 |   import { assert, describe, test, clearStore, beforeAll, afterAll } from "matchstick-as/assembly/index"
    > 3 |   import { Bytes, Address, BigInt, Array<Bytes } from "@graphprotocol/graph-ts"
        |                                         ^
      4 |   import { AddNomineeHash } from "../generated/schema"
      5 |   import { AddNomineeHash as AddNomineeHashEvent } from "../generated/Contract/Contract"
      6 |   import { handleAddNomineeHash } from "../src/contract"

@Shiyasmohd came up with a workaround where you change the input type in the abi temporarily from uint256[][] to uint256[] and then after the initialisation process or contract is added with the modified abi, you then change the input type back to its initial types, then running graph codegen .

Reproduction

https://github.com/itsjerryokolo/autonolas-subgraph

Steps to Reproduce the Bug or Issue

Initialise a subgraph using this contract: 0x5650300fCBab43A0D7D02F8Cb5d0f039402593f0.

Expected behavior

Initialisation process should be successful.

Screenshots or Videos

No response

Platform

nil

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

No response

itsjerryokolo avatar Jul 30 '24 12:07 itsjerryokolo