if I have a datamodel as such: ```js type Club { ...
# orm-help
m
if I have a datamodel as such:
Copy code
js
type Club {
    id: ID! @unique
    createdAt: DateTime!
    name: String!
    description: String!
    members: [User!]!
}

type User {
    id: ID! @unique
    firstName: String!
    lastName: String!
    email: String! @unique
    clubs: [Club!]!
    password: String!
}
where there's a relationship between Users and Clubs (Clubs can have many
members
(Users) and Users can belong to many
clubs
) I'd like to make a mutation that adds an existing
User
to an existing
Club
. This is what I have, and it's not working:
Copy code
js
async function addUserToClub(parent, args, context, info) {
      console.log('connecting user with id: ' + args.id);
      console.log('to: ' + args.clubid);
      const user = context.prisma.updateUser({
          data: {
              clubs: {
                connect: [
                    {
                        id: args.clubid
                    }
                ]   
              }
          },
          where: {
              id: args.id
          }
      })

      return user;
  }
Basically, the call is successful but there is no relationship created (e.g. doing a query for the user and their
clubs
... clubs is
null
)
Does anyone see any immediate issues with this syntax or how I'm going about this relationship creation?
Also please let me know if I should post this in the forum! Thanks!
I've also tried just a single object in the connect block, e.g:
Copy code
clubs: {
                connect: 
                    {
                        id: args.clubid
                    }
              }
with no luck either