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

Method createSrcFunction

query/query.go:320–346  ·  view source on GitHub ↗
(gf *dql.Function)

Source from the content-addressed store, hash-verified

318}
319
320func (sg *SubGraph) createSrcFunction(gf *dql.Function) {
321 if gf == nil {
322 return
323 }
324
325 sg.SrcFunc = &Function{
326 Name: gf.Name,
327 Args: append(gf.Args[:0:0], gf.Args...),
328 IsCount: gf.IsCount,
329 IsValueVar: gf.IsValueVar,
330 IsLenVar: gf.IsLenVar,
331 }
332
333 // type function is just an alias for eq(type, "dgraph.type").
334 if gf.Name == "type" {
335 sg.Attr = "dgraph.type"
336 sg.SrcFunc.Name = "eq"
337 sg.SrcFunc.IsCount = false
338 sg.SrcFunc.IsValueVar = false
339 sg.SrcFunc.IsLenVar = false
340 return
341 }
342
343 if gf.Lang != "" {
344 sg.Params.Langs = append(sg.Params.Langs, gf.Lang)
345 }
346}
347
348// DebugPrint prints out the SubGraph tree in a nice format for debugging purposes.
349func (sg *SubGraph) DebugPrint(prefix string) {

Callers 3

treeCopyFunction · 0.95
newGraphFunction · 0.95
filterCopyFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected