Refactor rename 'Select.Table to Select.Name`

This commit is contained in:
Vikram Rangnekar
2019-11-29 01:38:23 -05:00
parent 6d47f0df8e
commit a96c211fe5
8 changed files with 73 additions and 58 deletions

View File

@ -300,7 +300,7 @@ func (c *coreContext) addTrace(sel []qcode.Select, id int32, st time.Time) {
n--
for i := id; ; i = sel[i].ParentID {
path[n] = sel[i].Table
path[n] = sel[i].Name
if sel[i].ParentID == -1 {
break
}
@ -310,7 +310,7 @@ func (c *coreContext) addTrace(sel []qcode.Select, id int32, st time.Time) {
tr := resolver{
Path: path,
ParentType: "Query",
FieldName: sel[id].Table,
FieldName: sel[id].Name,
ReturnType: "object",
StartOffset: 1,
Duration: du,
@ -349,7 +349,7 @@ func parentFieldIds(h *xxhash.Digest, sel []qcode.Select, skipped uint32) (
}
p := sel[s.ParentID]
k := mkkey(h, s.Table, p.Table)
k := mkkey(h, s.Name, p.Name)
if r, ok := rmap[k]; ok {
fm[n] = r.IDField

View File

@ -175,7 +175,7 @@ func renderUserQuery(
func hasTablesWithConfig(qc *qcode.QCode, role *configRole) bool {
for _, id := range qc.Roots {
t, err := schema.GetTable(qc.Selects[id].Table)
t, err := schema.GetTable(qc.Selects[id].Name)
if err != nil {
return false
}

View File

@ -80,7 +80,7 @@ func resolveRemote(
// then use the Table nme in the Select and it's parent
// to find the resolver to use for this relationship
k2 := mkkey(h, s.Table, p.Table)
k2 := mkkey(h, s.Name, p.Name)
r, ok := rmap[k2]
if !ok {
@ -148,7 +148,7 @@ func resolveRemotes(
// then use the Table nme in the Select and it's parent
// to find the resolver to use for this relationship
k2 := mkkey(h, s.Table, p.Table)
k2 := mkkey(h, s.Name, p.Name)
r, ok := rmap[k2]
if !ok {
@ -167,7 +167,7 @@ func resolveRemotes(
b, err := r.Fn(hdr, id)
if err != nil {
cerr = fmt.Errorf("%s: %s", s.Table, err)
cerr = fmt.Errorf("%s: %s", s.Name, err)
return
}
@ -180,7 +180,7 @@ func resolveRemotes(
if len(s.Cols) != 0 {
err = jsn.Filter(&ob, b, colsToList(s.Cols))
if err != nil {
cerr = fmt.Errorf("%s: %s", s.Table, err)
cerr = fmt.Errorf("%s: %s", s.Name, err)
return
}