shouldn't this `Create` permission only allow you ...
# prisma-whats-new
c
shouldn't this
Create
permission only allow you to create a
Customer
if your authenticated
User.id
matches the
Customer.createdBy.id
?
Copy code
query ($user_id: ID!) {
  SomeCustomerExists(filter: {
    createdBy: {
      id: $user_id 
    }
  })
}
what's strange is, the mutation to create a customer uses
createdById
, I would have thought the permission would have allowed you to do:
Copy code
query ($user_id: ID!) {
  SomeCustomerExists(filter: {
    createdById: $user_id 
  })
}
maybe that's why the permission isn't working?
ok, got it working, I needed to do a relation permission:
Copy code
query ($user_id: ID!, $createdByUser_id: ID!) {
  SomeUserExists(filter: {
    AND: [
      { id: $user_id },
      { id: $createdByUser_id }
    ]
  })
  SomeCustomerExists(filter: {

  })
}
looks like this works for a create permission
Copy code
query ($user_id: ID!, $input_createdById: ID!) {
  SomeUserExists(filter: {
      AND: [
        { id: $user_id },
        { id: $input_createdById }
      ]
   })
}