Skip to content

Commit

Permalink
feat: add subquery hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
tokebe committed Apr 9, 2024
1 parent a54175b commit 70ff9e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/call-apis/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
"dependencies": {
"@biothings-explorer/api-response-transform": "workspace:../api-response-transform",
"@biothings-explorer/smartapi-kg": "workspace:../smartapi-kg",
"biomedical_id_resolver": "workspace:../biomedical_id_resolver",
"@biothings-explorer/utils": "workspace:../utils",
"@sentry/node": "^7.74.1",
"axios": "^0.21.4",
"axios-retry": "^3.8.1",
"biomedical_id_resolver": "workspace:../biomedical_id_resolver",
"debug": "^4.3.4",
"husky": "^4.3.8",
"nunjucks": "^3.2.4"
"json-stable-stringify": "^1.1.1",
"nunjucks": "^3.2.4",
},
"devDependencies": {
"@commitlint/cli": "^11.0.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/call-apis/src/queries/subquery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ export default class Subquery {
}
}

get hash(): string {
return crypto
.createHash("md5")
.update(stringify(this.constructAxiosRequestConfig()))
.digest("hex");
}

/**
* Construct the request config for Axios reqeust.
Expand Down

0 comments on commit 70ff9e9

Please sign in to comment.