Skip to content

Commit

Permalink
Fix legacy matrix-get calls - pass hydrate item to get call. #53
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidaguerre committed Mar 2, 2021
1 parent 60488ff commit 0bb9f6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugin/table_fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (t *Table) getForEach(ctx context.Context, queryData *QueryData, rd *RowDat
// create a context with the matrix item
fetchContext := context.WithValue(ctx, context_key.MatrixItem, matrixItem)

item, err := getCall(fetchContext, queryData, &HydrateData{})
item, err := getCall(fetchContext, queryData, &HydrateData{Item: rd.Item})
if err != nil {
errorChan <- err
} else if item != nil {
Expand Down Expand Up @@ -361,9 +361,10 @@ func (t *Table) executeLegacyGetCall(ctx context.Context, queryData *QueryData)
queryData.streamError(err)
return
}

t.Plugin.Logger.Debug("executeLegacyGetCall", "hydrateInput", hydrateInput)
// there may be more than one hydrate item - loop over them
for _, hydrateItem := range hydrateInput {
t.Plugin.Logger.Debug("hydrateItem", "hydrateItem", hydrateItem)
if err := t.doGet(ctx, queryData, hydrateItem); err != nil {
queryData.streamError(err)
break
Expand Down

0 comments on commit 0bb9f6f

Please sign in to comment.