(gf *dql.Function)
| 318 | } |
| 319 | |
| 320 | func (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. |
| 349 | func (sg *SubGraph) DebugPrint(prefix string) { |
no outgoing calls
no test coverage detected