Skip to content

--protocol flag breaks graph init with TypeError: Cannot read properties of undefined (reading 'contract') #1472

Closed
@itsjerryokolo

Description

@itsjerryokolo

Which packages are impacted by your issue?

@graphprotocol/graph-cli

Describe the issue

When initialising a new contract using graph init on graph cli: 0.58, adding a --protocol flag breaks the initialisation process.

Reproduction

nil

Steps to Reproduce the Bug or Issue

Run this command graph init --from-contract 0xc9fe4ffc4be41d93a1a7189975cd360504ee361a --protocol ethereum --network mainnet --contract-name Token --index-events

It breaks with the error below when you add the --protocol and --network flags
Screenshot 2023-10-02 at 12 51 43 PM

Expected behavior

Screenshot 2023-10-02 at 12 57 05 PM

Network should be pulled from the network flag instead of displaying undefined network: mainnet

Screenshot 2023-10-02 at 12 57 42 PM

Screenshots or Videos

No response

Platform

@graphprotocol/graph-cli/0.58.0 darwin-arm64 node-v18.16.0

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions