Comments (9)
➤ meteor-bot commented:
@mhuggins: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/
from apollo-link-state.
➤ James Baxley commented:
@mhuggins the desired behavior for SSR is to fetch the first time, then to read from the cache during the second loop when creating the components. Since react-apollo uses a two round render on the server, it is important to not send queries (force-fetch) the second time around
from apollo-link-state.
➤ Matt Huggins commented:
@jbaxleyiii By using cache on the server, every subsequent request has stale data since the underlying DB may be updating regularly while the apollo cache maintains an older version. How do you make the cache bust between requests?
from apollo-link-state.
➤ milanvdmria commented:
@jbaxleyiii It mainly doesn't make sense when you are also using Apollo to validate some user input. The user enters a certain product, the front end logic changes based on the fact if that product already exists yes or no.
If the caching strategy is forced, the check will always be performed on the very first product the user wants to add and all the consequent products are never correctly checked.
As mentioned in the PR, this forced caching strategy is causing unexpected behavior and issues for quite some people without adding extra value. What could possibly be the advantage of taking away some configuration options from the user?
from apollo-link-state.
➤ Mateusz Bagiński commented:
@mhuggins @milanvdmria ping
from apollo-link-state.
➤ Matt Huggins commented:
Not sure why I'm being pinged.
from apollo-link-state.
➤ Mateusz Bagiński commented:
Any changes?
from apollo-link-state.
➤ Matt Huggins commented:
My recommended change is in this PR.
from apollo-link-state.
➤ Kay Sackey commented:
@jbaxleyiii Typically the client/server implementations will diverge quite a bit during the setup-phase of the app by necessity.
Even, React itself doesn't have an identical API for rendering on the server, versus attaching to the DOM.
Accordingly, I think the best practice would be creating a server-side apollo client without caching, and a client-side apollo client with caching. Having the option being forced without warning was a bit surprising, especially since the vanilla client doesn't do this.
from apollo-link-state.
Related Issues (20)
- how to query local state by Id HOT 9
- Feature Request: Add an Opt In for using Service Workers or Workers for state management
- How to pass variable from local state HOT 2
- Is clientState.resolvers required or optional?
- Apollo: Problem triggering local state mutation via componentDidMount() HOT 1
- How should I update local state after fetching remote data? HOT 1
- Cannot read property '__typename' of undefined
- Client mutation failed to update (array of objects with different shapes)
- Missing field session in {} HOT 1
- Stupid docs HOT 7
- When calling execute directly on link, resolver cache argument is undefined
- Support for custom scalars
- ⚠️ This project is being deprecated ⚠️ HOT 2
- Store function references?
- Defining fragment properties on resolvers
- How to read Data one object from array of objects from cache. HOT 1
- Slow function call to store
- Not compatible with [email protected]: Cannot find module 'graphql-anywhere/lib/async' HOT 9
- How to let Query componet only fetch cache data only in first time componet building?
- Is it possible to have computed / derived state?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apollo-link-state.