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
|
ff := fr.Fields
|
||||||
|
|
||||||
parent := &fields[pid]
|
|
||||||
|
|
||||||
n := int32(len(fields))
|
n := int32(len(fields))
|
||||||
fields = append(fields, ff...)
|
fields = append(fields, ff...)
|
||||||
|
|
||||||
|
@ -454,9 +452,8 @@ func (p *Parser) parseFragmentFields(st *Stack, fields []Field) ([]Field, error)
|
||||||
// previous field.
|
// previous field.
|
||||||
if f.ParentID == -1 {
|
if f.ParentID == -1 {
|
||||||
f.ParentID = pid
|
f.ParentID = pid
|
||||||
|
|
||||||
if f.ParentID != -1 {
|
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
|
// Update all the other parents id's by our new place in this new array
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -481,6 +481,7 @@ func (com *Compiler) compileQuery(qc *QCode, op *Operation, role string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
qc.Selects = selects[:id]
|
qc.Selects = selects[:id]
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue