Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
itsjerryokolo opened this issue Jul 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@itsjerryokolo
Copy link

itsjerryokolo commented Jul 30, 2024

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 itsjerryokolo added the bug Something isn't working label Jul 30, 2024
@itsjerryokolo itsjerryokolo changed the title graph-cli failing to generate types for multi-dimensional arrays graph-cli failing to generate types for multi-dimensional arrays on graph init and graph add Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Bug
Development

No branches or pull requests

1 participant