after run a mutate, wether with dgraph-js-http
or row http(postman), the response is success, and return a new uid. but I can’t get the new data by query operation, why is that?
mutate:
query:
the params is valid, I copy it to the Ratel UI, it works fine then.
verneleem
(Verneleem)
March 20, 2021, 3:33pm
2
You have to use commitNow, ratel does this by default.
@verneleem thanks very much !
another question, I wonder what is the queryWithVars
method used for, for the variables can be passed by template string:
const {type} = req.query
const qs = `
{
roots(func:type(${type})) {
title
}
}
`
verneleem
(Verneleem)
March 20, 2021, 4:32pm
4
If you want to separate the query string from the script and where you define your query you may not have the variables.