MCPcopy
hub / github.com/chartbrew/chartbrew / applySourceVariables

Function applySourceVariables

server/sources/applySourceVariables.js:3–20  ·  view source on GitHub ↗
(dataRequest, variables = {})

Source from the content-addressed store, hash-verified

1const { findSourceForConnection } = require("./index");
2
3function applySourceVariables(dataRequest, variables = {}) {
4 const connection = dataRequest?.Connection;
5 const source = findSourceForConnection(connection);
6
7 if (source?.backend?.applyVariables) {
8 return source.backend.applyVariables({
9 dataRequest,
10 variables,
11 connection,
12 source,
13 });
14 }
15
16 return {
17 dataRequest,
18 processedQuery: dataRequest?.query,
19 };
20}
21
22module.exports = {
23 applySourceVariables,

Callers 3

runRequestMethod · 0.85
runRequestMethod · 0.85

Calls 1

findSourceForConnectionFunction · 0.70

Tested by

no test coverage detected