Khan/genqlient

Support gqlgen marshalling

Open

#147 geöffnet am 27. Okt. 2021

Auf GitHub ansehen
 (5 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Go (141 Forks)github user discovery
enhancementhelp wanted

Repository-Metriken

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

Beschreibung

Is your feature request related to a problem? Please describe. Custom scalars require marshal and unmarshal functions to tell genqlient how they work.

I already have marshal and unmarshal functions written for gqlgen. I don't want to have to write them a second time or add a layer of indirection to support both gqlgen and genqlient.

Describe the solution you'd like I would love for genqlient to respect the interfaces prescribed by gqlgen - specifically looking for MarshalGQL / UnmarshalGQL on custom types and supporting the UnmarshalX(v interface{}) (X, error) / MarshalX(v X) graphql.Marshaler APIs.

Describe alternatives you've considered Currently, I need to write functions that satisfy both the gqlgen and genqlient interfaces, both of which call into generic functions. This is particularly annoying when dealing with scalar types built-in to gqlgen.

Additional context

Contributor Guide