diff --git a/core/internal/qcode/parse.go b/core/internal/qcode/parse.go index 34f8825..3a451c3 100644 --- a/core/internal/qcode/parse.go +++ b/core/internal/qcode/parse.go @@ -440,8 +440,6 @@ func (p *Parser) parseFragmentFields(st *Stack, fields []Field) ([]Field, error) } ff := fr.Fields - parent := &fields[pid] - n := int32(len(fields)) fields = append(fields, ff...) @@ -454,9 +452,8 @@ func (p *Parser) parseFragmentFields(st *Stack, fields []Field) ([]Field, error) // previous field. if f.ParentID == -1 { f.ParentID = pid - if f.ParentID != -1 { - parent.Children = append(parent.Children, f.ID) + fields[pid].Children = append(fields[pid].Children, f.ID) } // Update all the other parents id's by our new place in this new array } else { diff --git a/core/internal/qcode/qcode.go b/core/internal/qcode/qcode.go index 795b0d1..a32157e 100644 --- a/core/internal/qcode/qcode.go +++ b/core/internal/qcode/qcode.go @@ -481,6 +481,7 @@ func (com *Compiler) compileQuery(qc *QCode, op *Operation, role string) error { } qc.Selects = selects[:id] + return nil }