Compare commits

..

7 Commits

Author SHA1 Message Date
Pilou
635d82b18f Merge pull request #678 from nhost/changeset-release/main
chore: update versions
2022-06-06 19:02:34 +02:00
github-actions[bot]
6a1def9b86 chore: update versions 2022-06-06 16:29:21 +00:00
Pilou
2cc075f4ef Merge pull request #677 from nhost/fix/subscription-headers
fix: add headers to subscription when creating the Apollo client
2022-06-06 18:28:27 +02:00
Pierre-Louis Mercereau
bbe6750632 chore: rephrase changeset 2022-06-06 18:28:08 +02:00
Johan Eliasson
19149261aa Merge pull request #676 from nhost/docs-emails-b8as9d
Docs abut emails with CLI
2022-06-06 13:59:08 +02:00
Pierre-Louis Mercereau
8b2d1b00a1 fix: add headers to subscription when creating the Apollo client 2022-06-06 13:34:27 +02:00
Johan Eliasson
3231e31c3e docs abuot emails with CLI 2022-06-06 08:08:09 +02:00
6 changed files with 38 additions and 4 deletions

View File

@@ -41,6 +41,12 @@ The following dependencies are required:
- [Git](https://git-scm.com/downloads)
- [Docker](https://www.docker.com/get-started) (must be running while using the CLI)
:::info
Make sure you have the correct permissions for Docker so you don't have to run Docker with `sudo`. See ["Post-installation steps for Linux"](https://docs.docker.com/engine/install/linux-postinstall/) from Docker's documentation.
:::
## Get started
Start by authenticating yourself to Nhost Cloud:
@@ -75,6 +81,18 @@ nhost up
Hasura Console starts automatically and your Nhost app is running locally with the backend URL: `http://localhost:1337`.
## Emails
During local development with the CLI, all transactional emails from Authentication are sent to a local Mailhog instance, instead of to the recipient's email address. You'll see an address where after starting [`nhost up`](/reference/cli/up) where all emails are sent to.
For the example below, all emails are accessable at `http://localhost:8839`.
```bash
$ nhost up
✔ Your app is running at http://localhost:1337 (Ctrl+C to stop)
Emails will be sent to http://localhost:8839
```
## What's next?
- Read our in-depth guide on [Get started with Nhost CLI](/platform/overview/get-started-with-nhost-cli)

View File

@@ -1,5 +1,11 @@
# @nhost/apollo
## 0.5.14
### Patch Changes
- 8b2d1b00: Add headers to the websocket connection when creating the Apollo client
## 0.5.13
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/apollo",
"version": "0.5.13",
"version": "0.5.14",
"description": "Nhost Apollo Client library",
"license": "MIT",
"keywords": [

View File

@@ -36,7 +36,7 @@ export const createApolloClient = ({
cache = new InMemoryCache(),
connectToDevTools = isBrowser && process.env.NODE_ENV === 'development',
onError
}: NhostApolloClientOptions): ApolloClient<unknown> => {
}: NhostApolloClientOptions): ApolloClient<any> => {
let backendUrl = graphqlUrl || nhost?.graphql.getUrl()
if (!backendUrl) {
throw Error("Can't initialize the Apollo Client: no backend Url has been provided")
@@ -71,7 +71,10 @@ export const createApolloClient = ({
createRestartableClient({
url: uri.startsWith('https') ? uri.replace(/^https/, 'wss') : uri.replace(/^http/, 'ws'),
connectionParams: () => ({
headers: getAuthHeaders()
headers: {
...headers,
...getAuthHeaders()
}
})
})
const wsLink = wsClient && new GraphQLWsLink(wsClient)

View File

@@ -1,5 +1,12 @@
# @nhost/react-apollo
## 4.2.16
### Patch Changes
- Updated dependencies [8b2d1b00]
- @nhost/apollo@0.5.14
## 4.2.15
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@nhost/react-apollo",
"version": "4.2.15",
"version": "4.2.16",
"description": "Nhost React Apollo client",
"license": "MIT",
"keywords": [