IO-3386
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user