Skip to content

Commit 846108c

Browse files
tas50claude
andcommitted
🐛 rippling: populate Internal struct when resolving resources by id
initRippling{Employee,Department,Team,Group} populated scalar args but left the Internal struct empty, so a resource resolved directly by id (e.g. rippling.employee(id: "x").manager) lost every cross-reference — manager / department / team / workLocation / parent / parentTeam resolved to null and group members to an empty list. Each init now builds the resource via the newMqlRippling* constructor, which sets the Internal struct, and returns it directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d9c3df8 commit 846108c

4 files changed

Lines changed: 29 additions & 12 deletions

File tree

providers/rippling/resources/department.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ func initRipplingDepartment(runtime *plugin.Runtime, args map[string]*llx.RawDat
4242
if departments[i].ID != id {
4343
continue
4444
}
45-
args["id"] = llx.StringData(departments[i].ID)
46-
args["name"] = llx.StringData(departments[i].Name)
47-
return args, nil, nil
45+
// Build the resource directly so the Internal struct's parentID is
46+
// populated — otherwise parent() would resolve to null.
47+
dept, err := newMqlRipplingDepartment(runtime, &departments[i])
48+
if err != nil {
49+
return nil, nil, err
50+
}
51+
return args, dept, nil
4852
}
4953
return nil, nil, errors.New("rippling.department with id " + id + " not accessible with the configured token")
5054
}

providers/rippling/resources/employee.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,14 @@ func initRipplingEmployee(runtime *plugin.Runtime, args map[string]*llx.RawData)
4646
if employees[i].ID != id {
4747
continue
4848
}
49-
populateEmployeeArgs(args, &employees[i])
50-
return args, nil, nil
49+
// Build the resource directly so the Internal struct's manager /
50+
// department / team / work-location IDs are populated — otherwise
51+
// those cross-references would resolve to null.
52+
emp, err := newMqlRipplingEmployee(runtime, &employees[i])
53+
if err != nil {
54+
return nil, nil, err
55+
}
56+
return args, emp, nil
5157
}
5258
return nil, nil, errors.New("rippling.employee with id " + id + " not accessible with the configured token")
5359
}

providers/rippling/resources/group.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ func initRipplingGroup(runtime *plugin.Runtime, args map[string]*llx.RawData) (m
4242
if groups[i].ID != id {
4343
continue
4444
}
45-
args["id"] = llx.StringData(groups[i].ID)
46-
args["name"] = llx.StringData(groups[i].Name)
47-
args["version"] = llx.StringData(groups[i].Version)
48-
return args, nil, nil
45+
// Build the resource directly so the Internal struct's memberIDs are
46+
// populated — otherwise members() would resolve to an empty list.
47+
g, err := newMqlRipplingGroup(runtime, &groups[i])
48+
if err != nil {
49+
return nil, nil, err
50+
}
51+
return args, g, nil
4952
}
5053
return nil, nil, errors.New("rippling.group with id " + id + " not accessible with the configured token")
5154
}

providers/rippling/resources/team.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ func initRipplingTeam(runtime *plugin.Runtime, args map[string]*llx.RawData) (ma
4242
if teams[i].ID != id {
4343
continue
4444
}
45-
args["id"] = llx.StringData(teams[i].ID)
46-
args["name"] = llx.StringData(teams[i].Name)
47-
return args, nil, nil
45+
// Build the resource directly so the Internal struct's parentTeamID
46+
// is populated — otherwise parentTeam() would resolve to null.
47+
t, err := newMqlRipplingTeam(runtime, &teams[i])
48+
if err != nil {
49+
return nil, nil, err
50+
}
51+
return args, t, nil
4852
}
4953
return nil, nil, errors.New("rippling.team with id " + id + " not accessible with the configured token")
5054
}

0 commit comments

Comments
 (0)