@custom does not send body

It is most likely due to the missing content type. When sending a JSON body the receiver must also receive the content-type.

This should resolve your issues:

type Mutation {
  auth(pass: String!, user: String!): Auth
    @custom(
      http: {
        url: "http://localhost:8081/auth",
        method: POST,
        body: "{pass:$pass,user:$user}"
        secretHeaders: ["Content-type"]
      }
    )
}
# Dgraph.Secret Content-type "application/json"

https://dgraph.io/docs/graphql/custom/directive/#dgraph-secret

3 Likes