-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement automatic data updates for adding a node to arrays and removing from arrays #1
Labels
enhancement
New feature or request
Comments
Example how we could mark explicitly arrays which could be automatically updated: const responseWithArray = {
x: 1,
list: {
type: 'LIST_1',
nodes: [{ id: 1, value: 'x' }],
},
}; Examples how responses hints could look like: // remove objects from all arrays
{ id: 1, _remove: '*' }
// append object to LIST_1
{ id: 1, _append: 'LIST_1' }
// append object to LIST_1 and LIST_2
{ id: 1, _append: ['LIST_1', 'LIST_2'] }
// prepend object to LIST_1 and LIST_2
{ id: 1, _prepend: [LIST_1', 'LIST_2'] }
// move object from LIST_1 to LIST_2
{ id: 1, _remove: 'LIST_1', _append: 'LIST_2' }
// replace object with id 1 with object with id 2
[{ id: 1, _remove: 'LIST_1' }, { id: 2, _append: 'LIST_1' }] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently for mutations like
ADD_BOOK
, orREMOVE_BOOK
, there are no automatic updates - without some extra hints, the library cannot know which arrays to update and how.It should be possible though with some extra hints.
The text was updated successfully, but these errors were encountered: