From 7e16f500cb7bc0cfd8bafbf6bb1555704f771231 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 29 Apr 2022 12:13:34 +0200 Subject: chore: remove old pages, components, helpers and types Since I'm using new components, I will also rewrite the GraphQL queries so it is easier to start from scratch. --- src/services/graphql/api.ts | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/services/graphql/api.ts (limited to 'src/services/graphql/api.ts') diff --git a/src/services/graphql/api.ts b/src/services/graphql/api.ts deleted file mode 100644 index a5be026..0000000 --- a/src/services/graphql/api.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { RequestType, VariablesType } from '@ts/types/app'; -import { settings } from '@utils/config'; -import { GraphQLClient } from 'graphql-request'; - -export const getGraphQLClient = (): GraphQLClient => { - const apiUrl = settings.api.url; - - if (!apiUrl) throw new Error('API URL not defined.'); - - return new GraphQLClient(apiUrl); -}; - -export const fetchApi = async ( - query: string, - variables: VariablesType -): Promise => { - const client = getGraphQLClient(); - - try { - return await client.request(query, variables); - } catch (error) { - console.error(error, undefined, 2); - process.exit(1); - } -}; -- cgit v1.2.3