1. Prevent possible race conditions of cache pruning, refetching and redirects
2. Note: the original code has the following defect.
SignOut action restarts the dev server effectively resetting the memory and erasing all the "registered users" data. You have to SignUp again after SignOut. I'm not sure how
to properly fix it a.t.m
* Fix api-routes-apollo-server-and-client-auth Example
`client.resetStore()` must be called after SignIn, SignOut actions
Otherwise, even the current basic auth is not working 100% of the time...
For example, as caching occurs here:
```
const { data, loading } = useQuery(ViewerQuery)
```
it sometimes (race conditions!) prevents a user from signing in
the current code base.
Check https://github.com/apollographql/apollo-cache-persist/issues/34#issuecomment-371177206 comment for more info.
* Fix api-routes-apollo-server-and-client-auth Example (linting)
* Repair advanced feature reference
The explanation of the custom document feature had been moved.
* Update README.md
Co-authored-by: Joe Haddad <timer150@gmail.com>
* Added example
* Updated readme of the dynamic-routing example
* Updated catch all docs
* Simplified example
* Update examples/catch-all-routes/README.md
Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
Co-authored-by: Joe Haddad <timer150@gmail.com>
* Let users define their own client token.
* Make sure users know that GraphQL schema can also be done via the UI
* Update README.md
* Update setup.js
Co-authored-by: Matthew Sweeney <mail@msweeneydev.com>
Co-authored-by: Joe Haddad <timer150@gmail.com>
* Update emotion to v10, use @emotion/core, @emotion/styled
* Add with-emotion-11 and make review changes
* Fix package names and run prettier
* fix readmes
Co-authored-by: Joe Haddad <timer150@gmail.com>
* Start from existing example
* Upgrade some dependencies
* Use dotenv
* Remove custom server
* Add serverless Firebase auth
* Add TODOs
* Update project name
* Fix build script
* Remove server middleware from client JS bundle
* Add logout functionality
* Redirect to auth page on logout
* Remove TODO
* Add comments about the cookie-session approach
* Remove the sessions folder
* Add comments for eslint
* Remove unused files
* Clarify comment
* Update README.md
* Rename variable for clarity
* Update README.md
* Change some comments
* Add more to gitignore
* Remove the bundle analyzer
* Move server-side auth user logic from _app.js to a HOC to support static HTML rendering
Co-authored-by: Joe Haddad <timer150@gmail.com>
* Add an example for Fauna using cookie based auth.
* Update example to use more secure method of non-js cookie and all authed access via backend api calls.
* Updated README
* Updated files and added prettier
* Remove unused import to fix lint issue.
* Improve documentation on how to setup fauna. Remove client key to simplify setup.
* Remove semicolons
* Lint fix
* Updated readme instructions and deployment
* Fixed client side redirect issue with /profile
* Simplified login code
* Simplified signup code
* Removed isomorphic-unfetch
* Simplified logout
* Removed get-host file
* Removed the custom getInitialProps from withAuthSync
* Removed user email from localStorage
Co-authored-by: Luis Alvarez D. <luis@zeit.co>
* New example with-typescript-graphql
* Update newer graphql-let
* Apply @lfades 's suggestions
* Use "lib" for tools directory
* Move config decorator to next.config.js
* Apply stricter tsconfig
* mod: hide the word "apollo" from users
* mod: Use variable name `withApollo`
* Use the later version of graphql-let
* Only pages can be in pages
* Life improvements
* fix: .grpahql-let.yml point to the wrong document path
* Use a wider glob for less pitfalls
* Add a note about it in README.md
Co-authored-by: Luis Alvarez D. <luis@zeit.co>
* add with-mobx-keystone-typescript example
* Use latest Next.js and removed gitignore
* Fixed my suggestions
* Enabled strict mode and simplified _app
Co-authored-by: Luis Alvarez D. <luis@zeit.co>
* Remove redefinition of apolloClient
It seems that the definition of `apolloClient` on line 47 seems to be a intended to be defining the `apolloClient` defined in global scope. That re-declaration of the `apolloClient` variable is removed in favor of assigning the return of `initApolloClient()` to the globally defined `apolloClient`
* Rename the global apollo client to globalApolloClient