Skip to content
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

Use thunk or some other kind of redux middleware to dispatch requests #722

Closed
tmeasday opened this issue Sep 28, 2016 · 2 comments
Closed

Comments

@tmeasday
Copy link
Contributor

tmeasday commented Sep 28, 2016

It seems more idiomatic Redux, and thus better supported by 3rd party redux tools which operate at the level of middleware/dispatched actions, to dispatch network requests in a middleware.

Discussions:

The basic proposal is rather than

  1. client.watchQuery().subscribe() calling

    a. QueryManager#fetchRequestOverInterface, which

    i. Dispatches APOLLO_QUERY_INIT, then
    ii. Fires a network request, which after returning
    iii. Dispatches APOLLO_QUERY_RESULTS

We should try

  1. client.watchQuery().subscribe() calls

    a. QueryManager#fetchRequestOverInterface, which

    i. Dispatches a thunk, which does i-iii. above.

Alternatively some other mechanism could be used to fire the request, via the client's middleware.

@tmeasday tmeasday added the idea label Sep 28, 2016
@helfer helfer added this to the New API/Refactor milestone Sep 29, 2016
@stubailo stubailo modified the milestone: Release 0.5 Oct 15, 2016
@helfer
Copy link
Contributor

helfer commented Jan 26, 2017

cc @calebmer Let's keep this in mind while we rethink the store architecture. If possible, it would be nice if our Redux integration could provide this.

@helfer
Copy link
Contributor

helfer commented May 3, 2017

Closing this up since it's pretty old and just an idea, not an issue.

@helfer helfer closed this as completed May 3, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants