I’m looking to use DGraph as part of my Apollo Federation. I’m currently running DGraph on GKE, not using Cloud.
What I’d like is to be able to hide to add/update/delete mutations from the outside, perhaps authenticating them with an API key so they can be accessible to my backend services.
Update - So I didn’t read your entire post when I responded, but I am assuming if you’re not using the dgraph graphql which is part of dgraph cloud, you’re going to have to create your own graphql endpoints, which gets complicated to use with Apollo Federation. Basically, you start from scratch with just dql, someone who knows this subject better than me can respond here…
You could create an @auth directive for each node like this:
Sounds like your second suggestion might be what I’ll look at first. I don’t want to add nodes later and forget to add the auth rules. Would this configuration be found in Ratel? I couldn’t find much about permissions in there.
Additionally, how would I go about accessing the writes from my backend in this scenario? I’d still like to be able to run the mutations but only from my backend, they should not be visible to any external clients.
To respond to your edit: I’m not sure exactly. I do have a graphql endpoint though from my GKE instance, and I was able to use curl -X POST localhost:8080/admin/schema --data-binary '@dgraph/schema.graphql' (after forwarding those ports) to upload my GraphQL schema just fine.