I have this code in a mutation and get an error th...
# orm-help
m
I have this code in a mutation and get an error that ‘OWNER’ is an invalid value because it expects a value for the Role enum.
Copy code
const owner = await ctx.db.mutation.createGroupMember(
    {
      data: {
        user: { connect: { id: userId } },
        role: { set: 'OWNER' },
      },
    },
    `{ id }`,
  );
This is my definition of the enum Role
Copy code
enum Role {
  OWNER
  ADMIN
  MEMBER
}`
Got it fixed, seems like the
{ set: 'OWNER'  }
is only necessary for arrays? It just had to be
role: 'OWNER'