nestjs-query icon indicating copy to clipboard operation
nestjs-query copied to clipboard

Option to update multiple

Open TriPSs opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe. I build dynamic forms in where I have to update one or multiple items, to run a GraphQL request for each item is not preferred and would like to do this in one call to the API. The existing updateMany only provides an update mechanising to update multiple records with the same data.

Have you read the Contributing Guidelines?

Yes

Describe the solution you'd like Add the option updateMultiple that accepts an array of inputs like the updateOne, loops through them and updates each record.

Describe alternatives you've considered Creating the resolver custom for each type requiring it. Hacking the frontend to create the GraphQL query dynamically and add the updateOne as many times as required.

TriPSs avatar Oct 25 '21 15:10 TriPSs

I think just executing many requests from the frontend should be a fairly reasonable solution. See a discussion on batch queries here: https://github.com/FormidableLabs/urql/issues/800

psteinroe avatar Oct 26 '21 09:10 psteinroe