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

refactor data reducer #383

Closed
wants to merge 1 commit into from
Closed

refactor data reducer #383

wants to merge 1 commit into from

Conversation

abhiaiyer91
Copy link
Contributor

@abhiaiyer91 abhiaiyer91 commented Jul 11, 2016

@@ -249,6 +249,7 @@ export class QueryManager {
variables,
mutationId,
fragmentMap: queryFragmentMap,
mutations: this.getApolloState().mutations,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to pass in all of the state about mutations and queries into the reducer - we only need the particular query this result is associated with. Same goes for the rest.

Copy link
Contributor Author

@abhiaiyer91 abhiaiyer91 Jul 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay so you wanna move that functionality out of data as well? so instead of returning mutationId or queryId in actions, we just cruise with the actual mutation/query we're dealing with?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still need mutationId in the store to keep track of loading/error state.

I think this change is great, we just should only pass in the data we actually need, which is basically only the single mutation, not all mutations ever sent.

@abhiaiyer91
Copy link
Contributor Author

Yeah I'll do that tonight

@stubailo
Copy link
Contributor

Closing this, Amanda is on it in #417

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants