summaryrefslogtreecommitdiffstats
path: root/src/services/graphql/api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/graphql/api.ts')
-rw-r--r--src/services/graphql/api.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/services/graphql/api.ts b/src/services/graphql/api.ts
index de8024f..33cc89a 100644
--- a/src/services/graphql/api.ts
+++ b/src/services/graphql/api.ts
@@ -6,9 +6,7 @@ export const getGraphQLClient = (): GraphQLClient => {
if (!apiUrl) throw new Error('API URL not defined.');
- const graphQLClient = new GraphQLClient(apiUrl);
-
- return graphQLClient;
+ return new GraphQLClient(apiUrl);
};
export const fetchApi = async <T extends RequestType>(
@@ -18,8 +16,7 @@ export const fetchApi = async <T extends RequestType>(
const client = getGraphQLClient();
try {
- const response = await client.request(query, variables);
- return response;
+ return await client.request(query, variables);
} catch (error) {
console.error(error, undefined, 2);
process.exit(1);