From d53d375d09dd86a85ffb249de1c0cc7c3b3438bc Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 4 Jan 2022 13:35:25 +0100 Subject: refactor: avoid useless assignement before return statement --- src/services/graphql/api.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/services/graphql/api.ts') 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 ( @@ -18,8 +16,7 @@ export const fetchApi = async ( 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); -- cgit v1.2.3