-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(changesets): version packages (#2206)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
864ce38
commit 8ce9d3f
Showing
9 changed files
with
136 additions
and
62 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,64 @@ | ||
# @commercetools-frontend/application-shell | ||
|
||
## 20.2.0 | ||
|
||
### Minor Changes | ||
|
||
- [#2198](https://github.com/commercetools/merchant-center-application-kit/pull/2198) [`864ce386`](https://github.com/commercetools/merchant-center-application-kit/commit/864ce386995a417f3bff2fd0ab052b5f2f59a196) Thanks [@emmenko](https://github.com/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. | ||
|
||
```diff | ||
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. | ||
|
||
```diff | ||
actions.forwardTo.get({ | ||
uri: 'https://my-custom-app.com/graphql', | ||
+ headers: { | ||
+ 'x-foo': 'bar', | ||
+ }, | ||
}); | ||
``` | ||
|
||
### Patch Changes | ||
|
||
- Updated dependencies [[`864ce386`](https://github.com/commercetools/merchant-center-application-kit/commit/864ce386995a417f3bff2fd0ab052b5f2f59a196)]: | ||
- @commercetools-frontend/[email protected] | ||
|
||
## 20.1.2 | ||
|
||
### Patch Changes | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8ce9d3f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: