MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / Mutate

Method Mutate

dgraphapi/cluster.go:689–704  ·  view source on GitHub ↗
(mutation string, commitNow bool)

Source from the content-addressed store, hash-verified

687}
688
689func (hc *HTTPClient) Mutate(mutation string, commitNow bool) ([]byte, error) {
690 url := hc.dqlMutateUrl
691 if commitNow {
692 url = hc.dqlMutateUrl + "?commitNow=true"
693 }
694
695 req, err := http.NewRequest(http.MethodPost, url, bytes.NewBufferString(mutation))
696 if err != nil {
697 return nil, errors.Wrapf(err, "error building req for endpoint [%v]", url)
698 }
699 req.Header.Add("Content-Type", "application/rdf")
700 if hc.HttpToken != nil {
701 req.Header.Add("X-Dgraph-AccessToken", hc.AccessJwt)
702 }
703 return DoReq(req)
704}
705
706func (hc *HTTPClient) MoveTablet(predicate string, group uint32) error {
707 url := fmt.Sprintf("%s?tablet=%s&group=%d", hc.moveTabletURL, predicate, group)

Callers

nothing calls this directly

Calls 2

DoReqFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected