I switched the file to typescript to give me the c...
# orm-help
n
I switched the file to typescript to give me the command completion which helped a lot. This successfully inserts into the join table -
Copy code
await prisma.user.update({
    where: {
      id: input.id,
    },
    data: {
      friended: {
        connect: {
          id: input.friendId,
        },
      },
    },
  })
Now I just need to figure out how to query on the friends for a user. I thought that I could just use a query like this -
Copy code
type User {
    id: Int!
    name: String!
    email: String!
    friended: [Int]
    friendedBy: [Int]
  }

  type Query {
    users: [User!]!
  }
But I just get nulls back for
friended
and
friendedBy