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

Function validateQuery

edgraph/server.go:2387–2399  ·  view source on GitHub ↗

validateQuery verifies that the query does not contain any preds that are longer than the limit (2^16).

(queries []*dql.GraphQuery)

Source from the content-addressed store, hash-verified

2385// validateQuery verifies that the query does not contain any preds that
2386// are longer than the limit (2^16).
2387func validateQuery(queries []*dql.GraphQuery) error {
2388 for _, q := range queries {
2389 if err := validatePredName(q.Attr); err != nil {
2390 return err
2391 }
2392
2393 if err := validateQuery(q.Children); err != nil {
2394 return err
2395 }
2396 }
2397
2398 return nil
2399}
2400
2401func validatePredName(name string) error {
2402 if len(name) > math.MaxUint16 {

Callers 1

parseRequestFunction · 0.85

Calls 1

validatePredNameFunction · 0.85

Tested by

no test coverage detected