My Products
Help
bergli84
CONTRIBUTOR **

Next available supplier no

by bergli84

Is there a clever way for fetching the next availible supplier no when creating a new supplier?

2 REPLIES 2
bergli84
CONTRIBUTOR **

by bergli84

Thanks @omelhus ðŸ•º

omelhus
PARTNER

by omelhus
mutation CreateSupplier($cid: Int!) {
  useCompany(no: $cid) {
    associate_create(
      values: [{ name: "New fancy supplier" }]
      suggest: { supplierNo: { from: 60000, to: 70000 } }
    ) {
      items {
        name
        supplierNo
      }
    }
  }
}