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

fix: check space and proposal exist #734

Merged
merged 1 commit into from
Oct 28, 2023
Merged

Conversation

wa0x6e
Copy link
Contributor

@wa0x6e wa0x6e commented Oct 27, 2023

in vp operation, check that proposal and space exist, and return meaningful error otherwise.

With this test query

query Vp{
		vp(
			space: "rocketposfsdfol-dao.eth",
      proposal: "asas",
			voter: "0x0000000000000000000000000000000000000000",
		) {
			vp
		}
	}
	

Before fix, it returns

{
  "errors": [
    {
      "message": "Cannot read properties of undefined (reading 'network')",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "vp"
      ]
    }
  ],
  "data": {
    "vp": null
  }
}

After fix, it returns

{
  "errors": [
    {
      "message": "space not found",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "vp"
      ]
    }
  ],
  "data": {
    "vp": null
  }
}

@wa0x6e wa0x6e requested a review from ChaituVR October 27, 2023 15:36
Copy link
Member

@ChaituVR ChaituVR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utAck

@wa0x6e wa0x6e merged commit 7e6cc67 into master Oct 28, 2023
2 checks passed
@wa0x6e wa0x6e deleted the check-variable-set-before-using branch October 28, 2023 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants