Files
bodyshop/server/graphql-client/graphql-client.js
Dave Richer f55764e859 feature/IO-2282-VSSTA-Integration:
- Boilerplate in new route
- Fix issues with imgproxy
- Clean up imgproxy
2025-04-09 14:56:49 -04:00

20 lines
542 B
JavaScript

const GraphQLClient = require("graphql-request").GraphQLClient;
//New bug introduced with Graphql Request.
// https://github.com/prisma-labs/graphql-request/issues/206
// const { Headers } = require("cross-fetch");
// global.Headers = global.Headers || Headers;
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {
headers: {
"x-hasura-admin-secret": process.env.HASURA_ADMIN_SECRET
}
});
const unauthorizedClient = new GraphQLClient(process.env.GRAPHQL_ENDPOINT);
module.exports = {
client,
unauthorizedClient
};