Improve error message for duplicated labels in enums

Open
#1,369 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
postgresql, rust

Research direction

Start by tracing subgraph schema enum validation and the path that produces the Postgres error. Reproduce the duplicated-label example with yes repeated, then verify that the resulting error identifies the affected enum and label and is covered by a regression test.

Written by the indexing model from the issue text.

Description

validation

Enums in subgraph schemas should have unique labels, i.e., the following should be rejected with a clear error message

enum Answer { yes no yes }

because yes appears twice.

Right now, users get a Postgres error message in that situation that doesn't tell them which enum/label is at fault.

Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from graphprotocol/graph-node

All issues in graphprotocol/graph-node

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.