Dgo support for GraphQL queries

Moved from GitHub dgo/126

Posted by vadavallipavan:

Dgraph now supports the standard graphQL queries and mutations , can you please advice the roadmap for dgo client to support the same -how can we use the generated query* , mutate* functions generated

parasssh commented :

cc: @pawanrawal @MichaelJCompton

MichaelJCompton commented :

Hi, yeah this is a great question for Dgo. Fo other languages, there’s really great GraphQL client support, for Go, not so much. There are libs like this but we should be able to do better with strong typing etc.

I wonder if we could take an approach like gqlgen (https://github.com/99designs/gqlgen) and generate a typed Go client given a GraphQL schema.

There really is no answer here. This is an outstanding issue we are trying to figure out in determining whether to use dgo or to use a third party graphql library in a golang application. What is the recommendation for today and the roadmap moving forward for developing a golang client for dgraph?

I would recommend using a 3rd party graphql library for this. I found shurcooL’s graphql client library to be very good for more complicated workloads, while machinebox’s graphql client library is a lot easier to use and very good for simple workloads.

We are looking at both of them. Is there a short-term recommendation to use third-party go GraphQL for queries and mutations, or just queries and continue to use dgo for mutations?

Any best practice advice would be much appreciated as there isnt a lot of information available on the docs yet.

I use dgo for DQL. I use shurcooL’s library for graphql queries and mutations.