[Doc] JSON DQL mutation for GraphQL Schema requires clarification

Yes, it is middleware, just not separate logic. Semantics.

Extremely strong statement to say useless. Lots of databases don’t give you the UID beforehand, it just depends on your setup. Without getting into it on this posts, this particular issue may be solvable by using @id instead, create a new post if you have questions about that.

That being said, I personally won’t use it as a full security level for mutations until some of the bugs and @auth feature requests are fulfilled.

Again, very strong opinion. GraphQL is meant to be consumed on the frontend just like Rest API (although not limited to frontend). There is a reason you pass Authorization headers. The spec just doesn’t care how you handle them (Constraints, Authentication, Authorization, use RBAC, GBAC…etc)

If you use GraphQL. You can use Dgraph without GraphQL. Just use the DQL schema directly and ignore the GraphQL schema. I suspect more than half its users don’t use GraphQL.

I have taken part in many internal and external discussions. The new Dgraph team is focusing on both: the GraphQL Layer and DQL Layer as a Graph Database. Ultimately the foundation needs to be good at the bottom layer-up regardless.

This is again another strong statement from you, as completely separating logic would slow down your app. Perhaps we can agree that from a DX perspective, it should be separate, but should ultimately compile down to give use the fastest queries possible without over-fetching.

Well everyone definitely agrees with this that has built a medium sized or larger project.

The GraphQL spec is simply not opinionated on how you handle business logic; I personally wish it were. The @auth directive is just one pattern, and definitely has its problems. It is also not meant to handle constraints either.

I believe the Dgraph team is aware of these sufficiencies, and will eventually find a better way to separate this logic from a DX perspective. There is just so much work to be done first. I personally like the way Hasura does it.

J

2 Likes