-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure ApolloProvider to always use fresh tokens #1609
Conversation
…hToken to be deparacated
@@ -20,12 +23,33 @@ const ApolloProviderWithFetchConfig: React.FunctionComponent<{ | |||
config?: Omit<ApolloClientOptions<InMemoryCache>, 'cache'> | |||
}> = ({ config = {}, children }) => { | |||
const { uri, headers } = useFetchConfig() |
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.
We could remove headers
here since this is where the auth-token and type came from previously.
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.
Doing so would save you an extra re-render.
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.
Yeah I intentionally didn't do that, wanted to remove this if/when FetchContext is removed if it makes sense?
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.
Yeah that make sense.
Co-authored-by: Peter Pistorius <peter.pistorius@gmail.com>
I like that the LGTM 🚀 |
This reverts commit ef14ece.
REVERTED See #1611 |
…h-tokens * 'main' of github.com:redwoodjs/redwood: Move whatwg-fetch from devDep to dep Adds mockCurrentUser() to api-side jest v0.22.1 v0.22.0 Revert "Configure ApolloProvider to always use fresh tokens (redwoodjs#1609)" (redwoodjs#1611) Configure ApolloProvider to always use fresh tokens (redwoodjs#1609) Ignore *.scenarios.* files. (redwoodjs#1607) upgrade prisma v2.12.1 (redwoodjs#1604) Test Scenarios (redwoodjs#1465) Use relative path to config stories location (redwoodjs#1509)
Starts fix for #1576. Implements proposal and discussion in #1608
Verified only with firebase, but individual provider changes will be added later.