livepeer / livepeer/subgraph

Remove @entity annotation from enum types

Open
#177 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
5
Forks
7
Avg merge
4h 1m
Merged PRs (30d)
6

Description

As pointed out by @jmulq, there are several enum types in our schema annotated with `@entity`:

https://github.com/livepeer/subgraph/blob/2180a42d4038b242a7bf74a410577bfcbd809a1c/schema.graphql#L308

https://github.com/livepeer/subgraph/blob/2180a42d4038b242a7bf74a410577bfcbd809a1c/schema.graphql#L111

According to The Graph docs, enum types cannot be entities:

* [https://thegraph.com/docs/en/subgraphs/guides/enums/#what-are-enums](https://thegraph.com/docs/en/subgraphs/guides/enums/#what-are-enums)

Although the subgraph currently deploys, this is not correct, so we should remove the `@entity` annotation from these enum definitions.

**Goal:** align the schema with The Graph’s specifications, avoid relying on undefined behavior, and prevent potential issues in future deployments or tooling.

Contributor guide

Open the contributing guide

Research direction

Open schema.graphql and inspect the enum definitions around lines 111 and 308. Compare them with The Graph's enum guidance, then remove only the @entity annotations from those enum definitions. Done means the schema no longer marks enum types as entities and remains valid for the subgraph.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.