gqlgen icon indicating copy to clipboard operation
gqlgen copied to clipboard

goModel/goField/goExtraField/goEnum x protobuf API_OPAQUE

Open flymedllva opened this issue 1 year ago • 1 comments

What happened?

The Golang team introduced the Go Protobuf: The new Opaque API

In it we closed public fields of the structure (instead, by making the Get/Set/Has/Clear{StructName} methods) and removed optional (pointer)

Screenshot 2024-12-19 at 02 36 58

Because of this, mapping to Protobuf via these GraphQL directives will not work when using API_OPAQUE.

What did you expect?

It may be worth modifying the directives to support fields as interfaces Get/Set/Has/Clear{StructName} methods

flymedllva avatar Dec 18 '24 23:12 flymedllva

Sure, this would be a good config option to add so people could opt-in. A PR would be welcome!

StevenACoffman avatar Dec 20 '24 19:12 StevenACoffman