Do not throw error if API_URI is not set
This commit is contained in:
parent
4ffbcd069d
commit
69336b8cca
1 changed files with 1 additions and 5 deletions
|
@ -12,10 +12,6 @@ Polly.register(NodeHttpAdapter);
|
||||||
Polly.register(FSPersister);
|
Polly.register(FSPersister);
|
||||||
|
|
||||||
function setupApi() {
|
function setupApi() {
|
||||||
if (!process.env.API_URI) {
|
|
||||||
throw new Error("Environment variable API_URI not set");
|
|
||||||
}
|
|
||||||
|
|
||||||
setupPolly({
|
setupPolly({
|
||||||
adapters: ["node-http"],
|
adapters: ["node-http"],
|
||||||
matchRequestsBy: {
|
matchRequestsBy: {
|
||||||
|
@ -42,7 +38,7 @@ function setupApi() {
|
||||||
const link = new BatchHttpLink({
|
const link = new BatchHttpLink({
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
fetch,
|
fetch,
|
||||||
uri: process.env.API_URI
|
uri: process.env.API_URI || "http://localhost:8000/graphql/"
|
||||||
});
|
});
|
||||||
const apolloClient = new ApolloClient({
|
const apolloClient = new ApolloClient({
|
||||||
cache,
|
cache,
|
||||||
|
|
Loading…
Reference in a new issue