You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by li...@apache.org on 2022/10/20 01:30:15 UTC
[incubator-devlake] 04/06: feat: save query vars into raw_table.input
This is an automated email from the ASF dual-hosted git repository.
likyh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 2927e3ce9b41ae05782e69644e9fb1c440eed703
Author: linyh <ya...@meri.co>
AuthorDate: Wed Oct 19 19:42:36 2022 +0800
feat: save query vars into raw_table.input
---
plugins/helper/graphql_collector.go | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/plugins/helper/graphql_collector.go b/plugins/helper/graphql_collector.go
index 261009b6..07999394 100644
--- a/plugins/helper/graphql_collector.go
+++ b/plugins/helper/graphql_collector.go
@@ -259,11 +259,15 @@ func (collector *GraphqlCollector) fetchAsync(divider *BatchSaveDivider, reqData
}
db := collector.args.Ctx.GetDal()
queryStr, _ := graphql.ConstructQuery(query, variables)
+ variablesJson, err := json.Marshal(variables)
+ if err != nil {
+ panic(err)
+ }
row := &RawData{
Params: collector.params,
Data: paramsBytes,
Url: queryStr,
- Input: reqData.InputJSON,
+ Input: variablesJson,
}
err = db.Create(row, dal.From(collector.table))
if err != nil {