-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Get rid of changedTodos in the outputFields of the MarkAllTodos mutation #126
Get rid of changedTodos in the outputFields of the MarkAllTodos mutation #126
Comments
Thanks for pointing this out! It is unused in the current implementation, but the current implementation also refetches the todos, whether or not their getFatQuery() {
return Relay.QL`
fragment on MarkAllTodosPayload {
changedTodos {
complete,
},
viewer {
todos {
completedCount,
},
},
}
`;
}
getConfigs() {
return [{
type: 'FIELDS_CHANGE',
fieldIDs: {
changedTodos: this.props.todos.edges[0].node.id,
viewer: this.props.viewer.id,
},
}];
} …but having to specify at least one Maybe there's something else that we could do here, like: /* ... */
getConfigs() {
return [{
type: 'FIELDS_CHANGE',
fieldIDs: {
changedTodos: 'any',
viewer: this.props.viewer.id,
},
}];
} … to signal that we want to intersect the fat query with the union of all the tracked queries for this type, and send the resultant query up with the mutation. Thoughts, @yuzhi @joesavona, @yungsters? |
I think the correct way to deal with this is to fetch |
But we do need to update the This has been implemented in relayjs/relay-examples#2 |
@steveluscher that repo doesn't seem to exist (or is private?) |
It's private, for a few moments longer. Stay tuned!
|
Cool, I can see it now, thanks! |
Specifically talking about this field:
relay/examples/todo/data/schema.js
Line 173 in 2a86be3
I can't find a reference to it in the client code at all.
Is it just unused? If so, maybe it could have a comment (or be removed?)
The text was updated successfully, but these errors were encountered: