realm-graphql icon indicating copy to clipboard operation
realm-graphql copied to clipboard

Add ability to append elements to an array

Open pierre-moire opened this issue 5 years ago • 3 comments

Hi,

Currently when we want to edit an array by adding an element we need to create a mutation with the full list of existing elements plus the new one, am I correct?

If yes, the payload can be quite big and 2 concurrent users will overlap each other. Is there a way to do it differently and just provide the new element in a mutation?

pierre-moire avatar Apr 02 '19 04:04 pierre-moire

Correct - the current mutation capabilities are not as flexible and efficient and we have plans to improve things there.

nirinchev avatar Apr 02 '19 07:04 nirinchev

Any news on this? This is a major performance issue when inserting data in big lists

pierre-moire avatar Sep 20 '19 16:09 pierre-moire

Currently when we want to edit an array by adding an element we need to create a mutation with the full list of existing elements plus the new one, am I correct?

Hey, just a question , have you done the above mentioned method with Entities instead of scalar types. Example -> ConversationEntity consists a list of MessageEntities. To add a new messageentity in conversationEntity i am mutating a new message entity and in the backend a listner attached to messageentities is attaching the message to the conversationEntity.

Can i mutate directly to conversationEntity so there is no need for a listner?

Regards.

hitesh22b avatar Oct 16 '19 07:10 hitesh22b