fix: issue with fragments related crash

This commit is contained in:
Vikram Rangnekar 2020-06-15 10:46:52 -04:00
parent dd4accfdd2
commit 7557a4c29c
2 changed files with 2 additions and 4 deletions

View File

@ -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 {

View File

@ -481,6 +481,7 @@ func (com *Compiler) compileQuery(qc *QCode, op *Operation, role string) error {
}
qc.Selects = selects[:id]
return nil
}