Can someone confirm the logic when in query permis...
# prisma-whats-new
g
Can someone confirm the logic when in query permissions I use multiple type filter like
Copy code
query ($engageInPact_id: ID!, $user_id: ID!, $participantsUser_id: ID!) {
  SomeUserExists(filter:{
    AND: [
      {id:$user_id}
      {id:$participantsUser_id}
    ]
  })
  SomePactExists(filter: {
    AND: [
      {id:$engageInPact_id}
      {OR:[
            {public:true}
            {viewerUsers_some: {id: $user_id} }
            {viewerGroups_some:{ users_some: {id: $user_id}} }
        ]}
    ]
  })
}
It seems to be a OR ?
n
@guillaume_ti it's actually an AND
g
ok thanks. Do you have a way to filter users to return TRUE only if $user_id is the same as an input user_id.
Like the auth user can only add a post on his id
n
yes, that's what you already do in your PQ, right?
g
if it is an AND it’s not working
n
is it not working such that it allows too much or that it allows too little?
g
FALSE AND TRUE == FALSE right?😀
n
yep
g
When I test with the first filter as FALSE (so auth user_id different than input user id) the mutation is done
let me refresh the playground like yesterday
n
what kind of operation is this permission defined on?
g
relations
n
and what's the mutation that you use to test it?
g
addto...
it’s working pretty good execpt with multiple filter type
n
could you please create a report here: https://github.com/graphcool/api-bugs/issues? 🙂
g
ok