Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Simplify GRPC GraphQL and DB Models into One Source of Truth

113 views
Skip to first unread message

Rakesh Chowdhury

unread,
Apr 23, 2025, 3:31:06 PMApr 23
to golang-nuts

Hello Everyone,

I'm building an api that allows CRUD via GRPC and Notifications Subscribe ie Read from GraphQL. I'm using gqlgen and protobuf protoc models.

my current issue is there are 3 models, sources of truth:

1. My Own Models for Interfacing with the DB

2. GraphQL Models for the Resolver interface

3. GRPC Models for the GRPC API


Is it possible to make this into 1 or atleast 2 model (ie source of truth?)

Adam Berkan

unread,
Apr 24, 2025, 4:16:43 PMApr 24
to golang-nuts
https://gqlgen.com/ can help with the graphql and go model parts.  You write a single schema and it helps generate the resolvers and the models.
Reply all
Reply to author
Forward
0 new messages