I'm getting a 504 error when trying to delete 3,00...
# prisma-whats-new
p
I'm getting a 504 error when trying to delete 3,000+ items. Is this normal?
Copy code
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<HTML><HEAD><META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">\n<TITLE>ERROR: The request could not be satisfied</TITLE>\n</HEAD><BODY>\n<H1>ERROR</H1>\n<H2>The request could not be satisfied.</H2>\n<HR noshade size=\"1px\">\nCloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.\n<BR clear=\"all\">\n<HR noshade size=\"1px\">\n<PRE>\nGenerated by cloudfront (CloudFront)\nRequest ID: iK0PeeqW7AT-S9pZZJqsAV6aYMob3X4bs2L2QdNzREE39sfAz1zcJg==\n</PRE>\n<ADDRESS>\n</ADDRESS>\n</BODY></HTML>
This is done via a giant mutation with multiple tags.
a
Yes, when mutations are too big, that tends to happen. Try to reduce the amount of mutations per batch. You can call multiple batches at the same time though. For example, 100 items per mutations, and 5 batches in parallel.
p
@agartha Thanks! Is 100 the maximum number possible before getting this error or was that just an arbitrary example?
a
Arbitrary. For 'regular' mutations I usually do 25-30, but for deletes you can do a bit more, because the mutations are smaller.
p
Interesting. Thanks for the info! I'm actually in the middle of writing a script to migrate our old backend into Graphcool and I needed to make a script to delete all test data in one go. 🙂
a
This scripts loops over the records to delete them: https://www.graph.cool/docs/faq/node-delete-all-nodes-iet3phoum8/