Is there a limite for many nested connect in Mutations?


#1

If a client decides to sell on few suburbs this happens:

suburb:{connect:[
    {id:"123"},{id:"1234"}            
 ]}

But if a client wants to sell on every 370 suburbs this happens:

 suburb:{connect:[
    {id:"any"}         
 ]}

Then inside the Mutation resolver I’m doing this:

 suburb = args.data.suburb.connect[0].id //get suburb input
 if(suburb === "any){
     suburbsIds = //get all 370 ids from that region;

     let ids=[];       
     suburbsIds.map(suburbsId=>{
          let x;
          x = JSON.stringify(suburbsId);
          x = JSON.parse(x);
          ids.push(x);   
     });

     return prisma.mutation.createCampaign({
       data:{
	owner:{connect:{id:userId}},
        ...args.data,
        liveAtSuburb:{connect:ids}  
     },info);
  }

If I reduce the number of suburbs in that region to 10, for example, it works!
But it won’t work if it has all 370 suburbs that I need!

So, Is there a limite for many nested connect in Mutations?

Thanks
Raf


#2

Looks like I was hitting the internal queueLimit of 1000 operations which Prisma can send to the database.

We can configure this limit now, starting version 1.32.1 using the queueSize parameter.
Here is an example:

version: '3'
services:
 prisma:
   image: prismagraphql/prisma:1.32
   restart: always
   ports:
     - '4466:4466'
   environment:
     PRISMA_CONFIG: |
       port: 4466
       databases:
         default:
           connector: postgres
           host: postgres
           port: 5432
           user: prisma
           password: prisma
           queueSize: 10000
 postgres:
   image: postgres:10.3
   restart: always
   environment:
     POSTGRES_USER: prisma
     POSTGRES_PASSWORD: prisma
   volumes:
     - postgres:/var/lib/postgresql/data
volumes:
 postgres: ~

I’ve not tried it yet and may no ever try, because I’m gonna use an array instead to avoid creating a huge table w/ a bunch of ids.

Hope that helps someone out there!
cheers
Raf