MCPcopy
hub / github.com/dgraph-io/dgraph / RunDQL

Method RunDQL

edgraph/query.go:18–34  ·  view source on GitHub ↗

Alter handles requests to change the schema or remove parts or all of the data.

(ctx context.Context, req *api.RunDQLRequest)

Source from the content-addressed store, hash-verified

16
17// Alter handles requests to change the schema or remove parts or all of the data.
18func (s *Server) RunDQL(ctx context.Context, req *api.RunDQLRequest) (*api.Response, error) {
19 apiReq, err := dql.ParseDQL(req.DqlQuery)
20 if err != nil {
21 return nil, fmt.Errorf("error parsing DQL query: %w", err)
22 }
23
24 apiReq.Vars = req.Vars
25 apiReq.ReadOnly = req.ReadOnly
26 apiReq.BestEffort = req.BestEffort
27 apiReq.RespFormat = req.RespFormat
28 if len(apiReq.Mutations) > 0 {
29 apiReq.CommitNow = true
30 }
31
32 ctx = x.AttachJWTNamespace(ctx)
33 return (&Server{}).doQuery(ctx, &Request{req: apiReq})
34}

Callers 1

TestNamespacesFunction · 0.80

Calls 4

ParseDQLFunction · 0.92
AttachJWTNamespaceFunction · 0.92
doQueryMethod · 0.80
ErrorfMethod · 0.45

Tested by 1

TestNamespacesFunction · 0.64