-
Notifications
You must be signed in to change notification settings - Fork 45
Next.js example #282
Comments
Currently, offix is using a similar concept as apollo-cache-perist where queries need to technically happens. Obviously there can be some layer of service workers available here but then we also do not need expensive offline support as modifications happen on server. I do think that we will need to know more about the case as it is currently hard to get how this even potentially would work. |
I have done some reading and in fact this is pretty much doable and documented in Apollo. Server sets initial state for cache and storage should handle it nicely. We will look how we can enable this feature but this is definitely not going to land to the next offix release. |
This is great! Thank you, looking forward to it. |
const { ApolloOfflineClient } = process.browser ? require('offix-client') : {}; |
maybe you should write something like this: instead: |
Since a workaround has been shown, we will be closing this issue. Since the primary use-case for Offix is to provide offline support, this would be difficult to implement into a next.js since this is being rendered from the server and would require a few workarounds to disable Offix, while offline. Thanks for your feedback! |
Feature Request
Is your feature request related to a problem? Please describe.
Not a current problem per se. Mainly looking for information/exemplification.
Describe the solution you'd like
Mainly I'd like to know how Offix would integrate with Next.js under the Zeit Now 2.0 serverless paradigm. This is because I've been looking for different options to make the queries/mutations from the combination of these two examples with-apollo and with-graphql-faunadb, to no avail.
Looked into apollo-cache-persist but found this issue, so I stopped there before trying it.
Is there a chance for an example such as this?
Thank you
The text was updated successfully, but these errors were encountered: