Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
Switch RedwoodProvider to RedwoodApolloProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Jan 25, 2021
1 parent 189e078 commit bbef52c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
7 changes: 4 additions & 3 deletions cookbook/GoTrue_Auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ By specifying `goTrue` as the provider, Redwood automatically added the necessar
import { AuthProvider } from '@redwoodjs/auth'
import GoTrue from 'gotrue-js'
import ReactDOM from 'react-dom'
import { RedwoodProvider, FatalErrorBoundary } from '@redwoodjs/web'
import { FatalErrorBoundary } from '@redwoodjs/web'
import { RedwoodApolloProvider } from '@redwoodjs/web/apollo'
import FatalErrorPage from 'src/pages/FatalErrorPage'

import Routes from 'src/Routes'
Expand All @@ -64,9 +65,9 @@ const goTrueClient = new GoTrue({
ReactDOM.render(
<FatalErrorBoundary page={FatalErrorPage}>
<AuthProvider client={goTrueClient} type="goTrue">
<RedwoodProvider>
<RedwoodApolloProvider>
<Routes />
</RedwoodProvider>
</RedwoodApolloProvider>
</AuthProvider>
</FatalErrorBoundary>,
document.getElementById('redwood-app')
Expand Down
24 changes: 12 additions & 12 deletions docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ netlifyIdentity.init()
ReactDOM.render(
<FatalErrorBoundary page={FatalErrorPage}>
<AuthProvider client={netlifyIdentity} type="netlify">
<RedwoodProvider>
<RedwoodApolloProvider>
<Routes />
</RedwoodProvider>
</RedwoodApolloProvider>
</AuthProvider>
</FatalErrorBoundary>,
document.getElementById('redwood-app')
Expand Down Expand Up @@ -113,9 +113,9 @@ const goTrue = new GoTrue({
ReactDOM.render(
<FatalErrorBoundary page={FatalErrorPage}>
<AuthProvider client={goTrue} type="goTrue">
<RedwoodProvider>
<RedwoodApolloProvider>
<Routes />
</RedwoodProvider>
</RedwoodApolloProvider>
</AuthProvider>
</FatalErrorBoundary>,
document.getElementById('redwood-app')
Expand Down Expand Up @@ -167,9 +167,9 @@ const auth0 = new Auth0Client({
ReactDOM.render(
<FatalErrorBoundary page={FatalErrorPage}>
<AuthProvider client={auth0} type="auth0">
<RedwoodProvider>
<RedwoodApolloProvider>
<Routes />
</RedwoodProvider>
</RedwoodApolloProvider>
</AuthProvider>
</FatalErrorBoundary>,
document.getElementById('redwood-app')
Expand Down Expand Up @@ -277,9 +277,9 @@ const azureActiveDirectoryClient = new UserAgentApplication({
ReactDOM.render(
<FatalErrorBoundary page={FatalErrorPage}>
<AuthProvider client={azureActiveDirectoryClient} type="azureActiveDirectory">
<RedwoodProvider>
<RedwoodApolloProvider>
<Routes />
</RedwoodProvider>
</RedwoodApolloProvider>
</AuthProvider>
</FatalErrorBoundary>,
document.getElementById('redwood-app')
Expand Down Expand Up @@ -330,9 +330,9 @@ const m = new Magic(process.env.MAGICLINK_PUBLIC)
ReactDOM.render(
<FatalErrorBoundary page={FatalErrorPage}>
<AuthProvider client={m} type="magicLink">
<RedwoodProvider>
<RedwoodApolloProvider>
<Routes />
</RedwoodProvider>
</RedwoodApolloProvider>
</AuthProvider>
</FatalErrorBoundary>,
document.getElementById('redwood-app')
Expand Down Expand Up @@ -385,9 +385,9 @@ const firebaseClient = ((config) => {
ReactDOM.render(
<FatalErrorBoundary page={FatalErrorPage}>
<AuthProvider client={firebaseClient} type="firebase">
<RedwoodProvider>
<RedwoodApolloProvider>
<Routes />
</RedwoodProvider>
</RedwoodApolloProvider>
</AuthProvider>
</FatalErrorBoundary>,
document.getElementById('redwood-app')
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ What you want to do not on the roadmap? Well, still go for it! We love spikes an
|[`@redwoodjs/router`](https://github.com/redwoodjs/redwood/blob/main/packages/router/README.md)|The built-in router for Redwood|
|[`@redwoodjs/structure`](https://github.com/redwoodjs/redwood/blob/main/packages/structure/README.md)|Provides a way to build, validate and inspect an object graph that represents a complete Redwood project|
|[`@redwoodjs/testing`](https://github.com/redwoodjs/redwood/blob/main/packages/testing/README.md)|Provides helpful defaults when testing a Redwood project's web side|
|[`@redwoodjs/web`](https://github.com/redwoodjs/redwood/blob/main/packages/web/README.md)|Configures a Redwood's app web side: wraps the Apollo Client in `RedwoodProvider`; defines the Cell HOC|
|[`@redwoodjs/web`](https://github.com/redwoodjs/redwood/blob/main/packages/web/README.md)|Configures a Redwood's app web side: wraps the Apollo Client in `RedwoodApolloProvider`; defines the Cell HOC|

## Contributing Docs

Expand Down
4 changes: 2 additions & 2 deletions docs/flashMessaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Flash makes use of [React's Context API](https://reactjs.org/docs/context.html)

## FlashContext

FlashContext is the headquarters for Redwood's Flash system. Its provider component is packaged with the `<RedwoodProvider />` component which makes it ready to use out of the box. Your components can pass (think, "send and receive") message objects by subscribing to it via the provided [useFlash hook](#useflash-hook).
FlashContext is the headquarters for Redwood's Flash system. Its provider component is packaged with the `<RedwoodApolloProvider />` component which makes it ready to use out of the box. Your components can pass (think, "send and receive") message objects by subscribing to it via the provided [useFlash hook](#useflash-hook).

FlashContext provides update functions which allow subscribed components to send and manipulate message objects. Subscribers can [consume](#consume-messages), [add](#add-a-message), [dismiss](#dismiss-a-message), and [cycle messages](#cycle-a-message).

Expand Down Expand Up @@ -148,7 +148,7 @@ const Message = ({ message }) => {

## useFlash hook

`useFlash` is an abridgment of `React.useContext(FlashContext)`. It allows you to subscribe to FlashContext's properties and functions from within any component nested within `<RedwoodProvider />`.
`useFlash` is an abridgment of `React.useContext(FlashContext)`. It allows you to subscribe to FlashContext's properties and functions from within any component nested within `<RedwoodApolloProvider />`.

```js
import { useFlash } from '@redwoodjs/web'
Expand Down

0 comments on commit bbef52c

Please sign in to comment.