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

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

Closed
itsjerryokolo opened this issue Oct 2, 2023 · 4 comments · Fixed by #1508
Assignees
Labels
bug Something isn't working

Comments

@itsjerryokolo
Copy link

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

@itsjerryokolo itsjerryokolo added the bug Something isn't working label Oct 2, 2023
@itsjerryokolo itsjerryokolo changed the title --protocol and --network flags breaks graph init with `TypeError: Cannot read properties of undefined (reading 'contract') --protocol and --network flags breaks graph init with TypeError: Cannot read properties of undefined (reading 'contract') Oct 2, 2023
@azf20
Copy link
Contributor

azf20 commented Oct 9, 2023

@itsjerryokolo do you see the same issue if you don't pass protocol?

@itsjerryokolo
Copy link
Author

itsjerryokolo commented Oct 9, 2023

@azf20 No, just running graph init or graph init --from-contract 0xc9fe4ffc4be41d93a1a7189975cd360504ee361a, and following the prompt, works.

@azf20
Copy link
Contributor

azf20 commented Oct 9, 2023

right if you run:

graph init --from-contract 0xc9fe4ffc4be41d93a1a7189975cd360504ee361a  --network mainnet --contract-name Token --index-events

i.e. without the protocol flag (but with the network flag)

@itsjerryokolo
Copy link
Author

Yes, just tried this and it worked

graph init --from-contract 0xc9fe4ffc4be41d93a1a7189975cd360504ee361a  --network mainnet --contract-name Token --index-events

@itsjerryokolo itsjerryokolo changed the title --protocol and --network flags breaks graph init with TypeError: Cannot read properties of undefined (reading 'contract') --protocol flags breaks graph init with TypeError: Cannot read properties of undefined (reading 'contract') Oct 9, 2023
@saihaj saihaj added this to Tooling Oct 12, 2023
@saihaj saihaj moved this to 🆕 New in Tooling Oct 12, 2023
@itsjerryokolo itsjerryokolo changed the title --protocol flags breaks graph init with TypeError: Cannot read properties of undefined (reading 'contract') --protocol flag breaks graph init with TypeError: Cannot read properties of undefined (reading 'contract') Oct 12, 2023
@theguild-bot theguild-bot mentioned this issue Oct 31, 2023
26 tasks
@saihaj saihaj moved this from 🆕 New to 👀 In review in Tooling Nov 15, 2023
@saihaj saihaj self-assigned this Nov 15, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Tooling Nov 16, 2023
This was referenced Apr 30, 2024
This was referenced May 7, 2024
@theguild-bot theguild-bot mentioned this issue Oct 15, 2024
26 tasks
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: Done
Development

Successfully merging a pull request may close this issue.

3 participants