According to https://graphql.dgraph.io/doc/custom/directive this example works:
type Mutation {
newMovie(title: String!, desc: String, dir: ID, imdb: ID): Movie @custom(http: {
url: "http://myapi.com/movies",
method: "POST",
body: "{ title: $title, imdbID: $imdb, storyLine: $desc, director: { id: $dir }}",
})
}
But does not work with underscores:
type Mutation {
newMovie(title: String!, desc: String, dir: ID, imdb: ID): Movie @custom(http: {
url: "http://myapi.com/movies",
method: "POST",
body: "{ my_title: $title, imdbID: $imdb, storyLine: $desc, director: { id: $dir }}",
})
}
Errors with: Type Mutation; Field newMovie; body template inside @custom directive could not be parsed.
Is it an error/omission? It would help if we could use underscores there.