Hello, just testing out Prisma 1.22.2 with MongoDB...
# orm-help
n
Hello, just testing out Prisma 1.22.2 with MongoDB in Docker. I have a data model like -
Copy code
type Game {
  id: ID! @id
  bag: [Tile!]!
}

type Tile @embedded {
  tileId: Int!
  letter: String!
  value: Int!
}
I'm trying to do a mutation like -
Copy code
mutation createGame {
  createGame(
    data: {
    	bag: [
        {
          letter: "Q"
          value: 10
        },
        {
          letter: "Z"
          value: 10
        }
      ]
    }
  ) {
    bag {
      letter
    }
  }
}
But my syntax is wrong. Any suggestions?
n
tileId
is non-null, so you need to set it
n
Thanks nuno, I'd missed that. I also missed the create keyword. The complete solution was . . .
Copy code
mutation createGame {
  createGame( 
    data: {
    	bag: {
        create: [
        {
          tileId: 1
          letter: "Q"
          value: 10
        }
        {
          tileId: 2
          letter: "Z"
          value: 10
        }
      	]
    	}
    }
  ) {
      bag {
      letter
      value
    }
  }
}