This commit is contained in:
Patrick Fic
2025-10-01 14:47:32 -07:00
parent a384fd5072
commit 5e308f13d3
5 changed files with 449 additions and 12 deletions

View File

@@ -1,3 +1,5 @@
const logger = require("../utils/logger");
const GraphQLClient = require("graphql-request").GraphQLClient;
//New bug introduced with Graphql Request.
@@ -11,9 +13,24 @@ const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {
}
});
const rpsClient =
process.env.RPS_GRAPHQL_ENDPOINT && process.env.RPS_HASURA_ADMIN_SECRET ?
new GraphQLClient(process.env.RPS_GRAPHQL_ENDPOINT, {
headers: {
"x-hasura-admin-secret": process.env.RPS_HASURA_ADMIN_SECRET
}
}) : null;
if (!rpsClient) {
//System log to disable RPS functions
logger.log(`RPS secrets are not set. Client is not configured.`, "WARN", "redis", "api", {
});
}
const unauthorizedClient = new GraphQLClient(process.env.GRAPHQL_ENDPOINT);
module.exports = {
client,
rpsClient,
unauthorizedClient
};