Skip to content

Commit

Permalink
fix: guard request with try/catch
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Murray <[email protected]>
  • Loading branch information
mikemurray committed Jul 2, 2020
1 parent b62cc32 commit 4a8ebe6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions staticUtils/graphQLRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import appConfig from "../config";
export default async function graphQLRequest(query, variables) {
const endpoint = appConfig.IS_BUILDING_NEXTJS === true ? appConfig.BUILD_GRAPHQL_URL : appConfig.INTERNAL_GRAPHQL_URL;

const graphQLClient = new GraphQLClient(endpoint, {
timeout: 20000
});

try {
const graphQLClient = new GraphQLClient(endpoint, {
timeout: 20000
});

const data = await graphQLClient.request(query, variables);
return data;
} catch (error) {
Expand Down

0 comments on commit 4a8ebe6

Please sign in to comment.