fix: issue with fragments related crash
This commit is contained in:
parent
dd4accfdd2
commit
7557a4c29c
|
@ -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 {
|
||||
|
|
|
@ -481,6 +481,7 @@ func (com *Compiler) compileQuery(qc *QCode, op *Operation, role string) error {
|
|||
}
|
||||
|
||||
qc.Selects = selects[:id]
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue