I have this rest app that gets data like this, with thunk + promise middlewares for redux:
export const fetchVenues = () => ({
type: 'FETCH_VENUES',
payload: axios.get('http://localhost:3000/mock/venues'),
});
The data from this goes into the store and components use the fetched data from there.
Can I swap the rest request in "payload" with a graphql query or something?
What confuses me is that Redux says: "Data lives in the store and can only be changed by actions", but Apollo binds the data directly to the components. I've already made a GraphQL API, works great in the graphiql devtool, but I'm a bit confused by the way it's handled in the client after reading this article.