@@ -417,7 +417,12 @@ func (sg *SubGraph) isSimilar(ssg *SubGraph) bool {
417417 // Below check doesn't differentiate between different filters.
418418 // It is added to differential between `hasFriend` and `hasFriend @filter()`
419419 if sg .Filters != nil {
420- if ssg .Filters != nil && len (sg .Filters ) == len (ssg .Filters ) {
420+ if ssg .Filters != nil {
421+ for idx , thisFilter := range sg .Filters {
422+ if ! thisFilter .isSimilar (ssg .Filters [idx ]) {
423+ return false
424+ }
425+ }
421426 return true
422427 }
423428 return false
@@ -541,24 +546,24 @@ func treeCopy(gq *gql.GraphQuery, sg *SubGraph) error {
541546 // children. But, in this case, we don't want to muck with the current
542547 // node, because of the way we're dealing with the root node.
543548 // So, we work on the children, and then recurse for grand children.
544- attrsSeen := make (map [string ]struct {})
549+ // attrsSeen := make(map[string]struct{})
545550
546551 for _ , gchild := range gq .Children {
547552 if sg .Params .Alias == "shortest" && gchild .Expand != "" {
548553 return errors .Errorf ("expand() not allowed inside shortest" )
549554 }
550555
551- key := ""
552- if gchild .Alias != "" {
553- key = gchild .Alias
554- } else {
555- key = uniqueKey (gchild )
556- }
557- if _ , ok := attrsSeen [key ]; ok {
558- return errors .Errorf ("%s not allowed multiple times in same sub-query." ,
559- key )
560- }
561- attrsSeen [key ] = struct {}{}
556+ // key := ""
557+ // if gchild.Alias != "" {
558+ // key = gchild.Alias
559+ // } else {
560+ // key = uniqueKey(gchild)
561+ // }
562+ // if _, ok := attrsSeen[key]; ok {
563+ // return errors.Errorf("%s not allowed multiple times in same sub-query.",
564+ // key)
565+ // }
566+ // attrsSeen[key] = struct{}{}
562567
563568 args := params {
564569 Alias : gchild .Alias ,
0 commit comments