Can i customize the graphql api in future?

Hi, I have seen the graphql api and have a few questions about it.

If i understand it correctly it spins up a graphql server and create queries & mutations for me.

it seems that I have no option to customize the generated resolvers or add own resolvers to it. Instead, I need to run a second graphql instance.

For me It would be more beneficial , if I can setup my own apollo-express server and get some utilities to translate resolvers easier to Dgraph. Something more advanced than Introduction - Join Monster

I understand that it is in early development and was wondering what you have planned in future.

Do you plan to make it more customaizable ? Thx!

I’m playing around this idea here GitHub - MichelDiz/Weasel: A direct GraphQL "converter" to Dgraph's `GraphQL+-` language.
The code is very embryonic and no fancy, but it is functional.

It’s kind of weird reading this while I’m doing it. It seems that there is demand. However, Dgraph’s support for GraphQL has other advantages out of the box than a direct translation from GQL+- to GQL would have.

1 Like

This is awesome! I will check it out tomorrow.

I started playing around with join-monster by adding additional properties to the field objects. My need is
to auto-generate CRUD resolvers and subscriptions as well as handling authorizations.

fields I can think of:

protected → database field that is not added to the graphql type
fillable → field appears in input type
default → default value if field is not present in the input argument of create resolver
guards: {read: [‘Guest’, ‘Member’], update: [‘Owner’, ‘Moderator’]}} //handels field authorizations

I am still confused with the goal of Dgraph’s support for GraphQL. The beta looks like it is moving more in the direction of Hasura. I see Hasura as good solutions for training, prototyping and simple apps. But experienced that it get cumbersome easily with advanced business logic.

I read this article but it also doesn’t answer it: https://blog.dgraph.io/post/building-native-graphql-database-dgraph/

Do you have more insights? Thx

Hi @johnson

We do have plans to support customization of the generated resolvers and also support addition of your own resolvers. We have a couple of ideas around how we can do it (supporting Go plugins vs isolating the graphql part into a Go library) but are yet to decide how to implement it. We don’t have a concrete timeline for you at this point but since this is a much requested feature, it would be prioritized and you can expect it soon.

2 Likes