79312530

Date: 2024-12-27 18:25:22
Score: 0.5
Natty:
Report link

I was able to get it working. I had to change my mutation file.

mutation {
  category_insert(
    data: {id: "2709c745-34c5-495d-9c89-85c4402350bf", active: false, description: "", name: "Home & Garden"}
  )

  category_insertMany(
    data: [
      {
        id: "22222222-3333-4444-5555-666666666666", 
        parent: {id: "2709c745-34c5-495d-9c89-85c4402350bf"}, 
        active: false, 
        description: "", 
        name: "Adult Clothing"
      }

In my original question, I was trying to add the parent category and children categories in the same _insertMany mutation.

So under the hood, graphql needed the parent record created first, then create the child records. After I made the above modification this mutation worked (I verified it in the database)

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Jim Shelly