Simple HTTP POST request is failing

Try JSON.stringify() in the body like so:

fetch('https://truncated.ap-south-1.aws.cloud.dgraph.io/admin', {
  method: 'POST',
  headers: {
    'Dg-Auth': DGRAPH_API_KEY,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    query: `your-query`,
    variables: `{ if there are variables here... }`
  })
});