aboutsummaryrefslogtreecommitdiffstats
path: root/src/services
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2022-03-04 16:49:41 +0100
committerArmand Philippot <git@armandphilippot.com>2022-03-04 16:49:41 +0100
commit4ed70beabc73dd9aa1d2e06ab5902ded0801c404 (patch)
tree05fb731e5c937be885c6d03f31f40f1f9fd2cf8c /src/services
parent4378c4553b17d5435b08387d80377bce666dc838 (diff)
chore: use a different configuration depending on app env
It will be useful with Docker. Instead of cloning the project with a different configuration, I can manage two different configuration thanks to dotenv and some checking inside the app.
Diffstat (limited to 'src/services')
-rw-r--r--src/services/graphql/api.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/services/graphql/api.ts b/src/services/graphql/api.ts
index 33cc89a..a5be026 100644
--- a/src/services/graphql/api.ts
+++ b/src/services/graphql/api.ts
@@ -1,8 +1,9 @@
import { RequestType, VariablesType } from '@ts/types/app';
+import { settings } from '@utils/config';
import { GraphQLClient } from 'graphql-request';
export const getGraphQLClient = (): GraphQLClient => {
- const apiUrl: string = process.env.NEXT_PUBLIC_GRAPHQL_API || '';
+ const apiUrl = settings.api.url;
if (!apiUrl) throw new Error('API URL not defined.');