@ikas/storefront 0.0.92 → 0.0.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.es.js +6 -1
- package/build/index.js +6 -1
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -10884,7 +10884,7 @@ var Apollo = /** @class */ (function () {
|
|
|
10884
10884
|
this.createApolloClient = function (apiKey) {
|
|
10885
10885
|
var authLink = setContext(function (_request, _a) {
|
|
10886
10886
|
var headers = _a.headers;
|
|
10887
|
-
var newHeaders = __assign(__assign({}, headers), { "x-api-key": apiKey || IkasStorefrontConfig.config.apiKey
|
|
10887
|
+
var newHeaders = __assign(__assign({}, headers), { "x-api-key": apiKey || IkasStorefrontConfig.config.apiKey });
|
|
10888
10888
|
if (Apollo.customerToken) {
|
|
10889
10889
|
newHeaders.Authorization = "Bearer " + Apollo.customerToken;
|
|
10890
10890
|
}
|
|
@@ -10892,8 +10892,13 @@ var Apollo = /** @class */ (function () {
|
|
|
10892
10892
|
headers: newHeaders,
|
|
10893
10893
|
};
|
|
10894
10894
|
});
|
|
10895
|
+
var customFetch = function (uri, options) {
|
|
10896
|
+
var operationName = JSON.parse(options.body).operationName;
|
|
10897
|
+
return fetch(uri + "?op=" + operationName, options);
|
|
10898
|
+
};
|
|
10895
10899
|
var httpLink = createHttpLink({
|
|
10896
10900
|
uri: IkasStorefrontConfig.apiUrlOverride || process.env.NEXT_PUBLIC_GQL_URL,
|
|
10901
|
+
fetch: customFetch,
|
|
10897
10902
|
});
|
|
10898
10903
|
_this._client = new ApolloClient({
|
|
10899
10904
|
link: authLink.concat(httpLink),
|
package/build/index.js
CHANGED
|
@@ -10898,7 +10898,7 @@ var Apollo = /** @class */ (function () {
|
|
|
10898
10898
|
this.createApolloClient = function (apiKey) {
|
|
10899
10899
|
var authLink = setContext(function (_request, _a) {
|
|
10900
10900
|
var headers = _a.headers;
|
|
10901
|
-
var newHeaders = __assign(__assign({}, headers), { "x-api-key": apiKey || IkasStorefrontConfig.config.apiKey
|
|
10901
|
+
var newHeaders = __assign(__assign({}, headers), { "x-api-key": apiKey || IkasStorefrontConfig.config.apiKey });
|
|
10902
10902
|
if (Apollo.customerToken) {
|
|
10903
10903
|
newHeaders.Authorization = "Bearer " + Apollo.customerToken;
|
|
10904
10904
|
}
|
|
@@ -10906,8 +10906,13 @@ var Apollo = /** @class */ (function () {
|
|
|
10906
10906
|
headers: newHeaders,
|
|
10907
10907
|
};
|
|
10908
10908
|
});
|
|
10909
|
+
var customFetch = function (uri, options) {
|
|
10910
|
+
var operationName = JSON.parse(options.body).operationName;
|
|
10911
|
+
return fetch(uri + "?op=" + operationName, options);
|
|
10912
|
+
};
|
|
10909
10913
|
var httpLink = createHttpLink({
|
|
10910
10914
|
uri: IkasStorefrontConfig.apiUrlOverride || process.env.NEXT_PUBLIC_GQL_URL,
|
|
10915
|
+
fetch: customFetch,
|
|
10911
10916
|
});
|
|
10912
10917
|
_this._client = new ApolloClient({
|
|
10913
10918
|
link: authLink.concat(httpLink),
|