How to use javaclient excute delete edge

delete {
<0x1> <_follows> <0x2> .
use DgraphClient excute

I invoke as follows

public void deleteEdge(){
	String operatJson =
			"\t{\n" +
			"\t\tdelete {\n" +
			"\t\t\t<0x1>  <follows>  <0x2> .\n" +
			"\t\t}\n" +

	DgraphProto.Mutation mutation = DgraphProto.Mutation.newBuilder()
	Transaction txn = dgraphClient.newTransaction();

but it throw Exception
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNKNOWN: invalid character ‘d’ looking for beginning of object key string
at java.util.concurrent.CompletableFuture.reportGet(
at java.util.concurrent.CompletableFuture.get(
at io.dgraph.DgraphAsyncClient.lambda$runWithRetries$2(
… 7 more

You are mixing NQuads with Json. As you are using setDeleteJson, following should work for your usecase:

String json = 
"{" +
"  \"uid\": \"0x1\"," +
"  \"follows\": \"0x2\"" +
DgraphProto.Mutation mutation = DgraphProto.Mutation.newBuilder()

you could use NQuads for deletion as follows:

String nquadStr = "<0x1> <follows> <0x2> .";
DgraphProto.Mutation mutation = DgraphProto.Mutation.newBuilder()

Notice the use of setDelNquads and setDeleteJson.

You can refer the the doc on Deletion using NQuads and following doc on Deletion using Json.

Thank you very much for the solution, but Json is still wrong. The correct Json is as follows
String operatJson =
“{\n” +
" “follows”: {\n" +
" “uid”: “0x7623”\n" +
" },\n" +
" “uid”: “0x7622”\n" +

Yeah! missed that.
Glad it worked!