graphprotocol / graphprotocol/graph-node

Cannot Sort queries by enum

Offen
#4,221 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

area/graphql enhancement Stale
Vorherrschende Sprache
Rust
Sterne
3.2k
Forks
1.1k
Ø Merge
4 T. 1 Std.
Gemergte PRs (30 T.)
1

Beschreibung

Do you want to request a feature or report a bug?

Feature (maybe bug)

What is the current behavior?

When you make a query and try to sort on an enum you get an error.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?

Ideally we would want to be able to sort using an enum. I believe the issue is that enum Types create a custom type that can't be sorted in AssemblyScript, but they are almost always strings. I guess I would imagine it should be stored as a string (maybe) and then it would be able to be sorted on like that.

Against my point, if you made an enum numbers it wouldn't be totally accurate.

Moral of the story, it would be nice to sort on enums. Example query

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der verlinkten GraphQL-Abfrage und reproduziere den Fehler beim Sortieren von Positionen nach dem Enum-Feld side. Da im Issue keine Dateien oder Tests genannt werden, verfolge die Verarbeitung von enum orderBy in der Abfrage; abgeschlossen ist die Aufgabe, wenn Enum-Felder zum Sortieren verwendet werden können und für String- und numerische Werte ein definiertes Verhalten vorliegt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
graphql, rust
Bereich
api, backend
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.