Khan/genqlient

Correctly handle self-recursive types automatically

Open

#152 geöffnet am 2. Nov. 2021

Auf GitHub ansehen
 (2 Kommentare) (7 Reaktionen) (0 zugewiesene Personen)Go (141 Forks)github user discovery
enhancementgood first issuehelp wanted

Repository-Metriken

Stars
 (1.310 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

(Split from #149.)

If you have in your schema

input T {
  f: T  # or `f: T!`
}

then genqlient by default generates

struct T {
  F T
}

which does not compile. Of course you can manually add pointer: true, but we could just do that automatically because it's the only valid way to represent this. Apparently this comes up a lot with Hasura-generated schemas, so although it seems a bit special-casey it's probably worth handling.

Contributor Guide