Releases: commercetools/merchant-center-application-kit
@commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Patch Changes
-
#2223
6de28034
Thanks @renovate! - chore(deps): update all dependencies -
#2160
7734f69e
Thanks @renovate! - Update dependency eslint-plugin-testing-library to v4 and usescreen
over assigning torendered
-
#2212
5961c019
Thanks @renovate! - chore(deps): update all dependencies -
Updated dependencies [
6de28034
,11a6c70d
,7e7b4996
,7734f69e
,5961c019
]:- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Patch Changes
- Updated dependencies [
6de28034
,11a6c70d
,5961c019
]:- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
@commercetools-backend/[email protected]
@commercetools-backend/[email protected]
@commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Minor Changes
-
#2198
864ce386
Thanks @emmenko! - Add support for sending custom HTTP headers when using the/proxy/forward-to
endpoint.See the examples below on how to configure the HTTP headers for both scenarios.
All custom HTTP headers are sent to the Merchant Center API with a prefix
x-forward-header-
, as it allows the Merchant Center API to allow requests with those headers to be forwarded. However, the request forwarded to the external API contains the correct headers without the prefix.Usage for Apollo
The
createApolloContextForProxyForwardTo
function now supports passing custom HTTP headers.import React from 'react'; import { createApolloContextForProxyForwardTo, useMcQuery, } from '@commercetools-frontend/application-shell'; import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors'; const Fetcher = () => { // Assuming that the `custom-application-config.json` contains the custom value: // `{ additionalEnv: { externalApiUrl: 'https://my-custom-app.com/graphql'} }` const externalApiUrl = useApplicationContext( context => context.environment.externalApiUrl ); const { loading, data, error } = useMcQuery(MyQuery, { context: createApolloContextForProxyForwardTo({ // The URL to your external API uri: externalApiUrl, + headers: { + 'x-foo': 'bar' + } }), }); // ... };
Usage for SDK actions
All
forwardTo
proxy actions supports sending custom HTTP headers.actions.forwardTo.get({ uri: 'https://my-custom-app.com/graphql', + headers: { + 'x-foo': 'bar', + }, });
@commercetools-frontend/[email protected]
Patch Changes
- Updated dependencies [
f8b4acc1
]:- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Patch Changes
-
Updated dependencies [
0bfa1613
]:- @commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Patch Changes
- Updated dependencies [
f8b4acc1
]:- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]