Using /graphql for creating schema and structure the database - even dgo will be the client


(J Czz) #1

Hi

I am am looking for a developer workflow - and I very much like gRPC and therefor will be using dgo in microservices on a Kubernetes cluster.

Is it wise to be using /graphql endpoint for creating schema and structure the database - even dgo will be the client.

I am thinking:

  1. Creating and exploring schems setup and queries in like GraphQL Playground
  2. Implement the queries etc. using dgo.

And is it/ will it ever be possible to use the queries from like GraphQL Playground in dgo?

Hope it is ok to ask this kind of open “no one solution question”.

Thanks for a great product


(Michael Compton) #2

Hi, thanks for the question. I hope these points cover what you want to know. If not, happy to talk more.

  • At the moment we are only exposing GraphQL over HTTP, but GraphQL± over both HTTP and gRPC.
  • I think it would be great to expose GraphQL over gRPC. We’ve talked about that a few times internally, but don’t currently have any concrete plans.
  • dgo is really a Dgraph client. A GraphQL client would probably look a bit different - take out transactions and other Dgraph specific featurs, and add some features that come from the typing in GraphQL. Again it’s a thing we’ve talked about - e.g. wouldn’t it be great if Dgraph had the best golang client libraries for GraphQL - but not something we have a specific plan about at the moment.

You can also use both GraphQL± (for example with dgo) and GraphQL on the same underlying Dgraph instance, so mixing up how you access it depending on the usecase is also possible.


(J Czz) #3

Hi Michael

Thanks, really good answer.
I am a really big fan of gRPC(no need to marshalling back and forth).

Do you know this one from Google: https://github.com/google/rejoiner
I was thinking about setting it up as a gRPC way into dgraphs graphql?
Update:
Hmm, just looked at rejoiner it a little more, it looks like it is a front-end graphQL to backend gRPC services…

But you answered my question well, but happy to hear any toughts.

But a good point you described is dgo and transactions - I will stick with dgo and see what the future brings :slight_smile: