toystack
Version:

21 lines (20 loc) • 864 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const client_1 = require("@apollo/client");
const apollo_upload_client_1 = require("apollo-upload-client");
const cross_fetch_1 = __importDefault(require("cross-fetch"));
const dotenv_1 = __importDefault(require("dotenv"));
dotenv_1.default.config();
const API_BASE_URL = process.env.API_BASE_URL || "https://core.toystack.ai";
const client = new client_1.ApolloClient({
//link: new HttpLink({ uri: process.env.TOYSTACK_BACKEND_URL, fetch }),
link: (0, apollo_upload_client_1.createUploadLink)({
uri: API_BASE_URL,
fetch: cross_fetch_1.default,
}),
cache: new client_1.InMemoryCache(),
});
exports.default = client;
;