Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cold-peas-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vue-storefront/magento-api": minor
---

** [CHANGED] ** - increase the HttpAgent socket timeout from `10s` to `30s` to prevent timeout errors on slow connections.
6 changes: 4 additions & 2 deletions packages/api-client/src/helpers/magentoLink/graphQl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import possibleTypes from "../../types/possibleTypes.json";
import standardURL from "../url/standardURL";

const { HttpsAgent } = AgentKeepAlive;
const agent = new HttpsAgent();
const agent = new HttpsAgent({
timeout: 30000,
});

const createErrorHandler = () =>
onError(({ graphQLErrors, networkError }) => {
Expand Down Expand Up @@ -48,7 +50,7 @@ export const apolloLinkFactory = (
) => {
const baseLink =
handlers?.apolloLink ||
setContext((apolloReq, { headers }) => ({
setContext((_apolloReq, { headers }) => ({
headers: {
...headers,
},
Expand Down
Loading