danielvladco / go-proto-gql

Protobuf plugins for generating graphql schema and golang to graphql bindings. Also supports a graphql gateway (Alpha)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add sensible scalar types for well-known types (wkts) especially google.protobuf.Struct

perrydunn opened this issue · comments

Currently the GraphQL generated for google.protobuf.Struct (which represents JSON in protobuf) is a recursive type which introduces depth and cycle issues.

Proposal: Create a GraphQL scalar type scalar JSON to represent JSON (google.protobuf.Struct) as a leaf value. It would then be a good idea to ship an implementation in gqlgen.

Similarly other wkts could have reconsidered scalar types, such as google.protobuf.Timestamp as scalar Time for which there is already a gqlgen implementation.