Anyone know of a way to easily check what permissi...
# prisma-whats-new
n
Anyone know of a way to easily check what permissions are invalid?
{"data":{"createReport":null},"errors":[{"locations":[{"line":2,"column":3}],"path":["createReport"],"code":3008,"message":"Permission Query is invalid. Could not be parsed. Error Message: Syntax error while parsing GraphQL query. Invalid input \"query ($user_id: ID) q\", expected OperationDefinition, FragmentDefinition or TypeSystemDefinition (line 1, column 1):\nquery ($user_id: ID) query($user_id: ID!) {\n^","requestId":"eu-west-
a
try them one by one 😁
a
Are you deploying from the new CLI?
n
😭
Yah
a
You need to remove the query 'header' from your permission queries
Copy code
query (field: ID!) #remove this line
{
SomeX....
}
🎉 1
n
I’ve no idea how anyone keeps up with these API changes haha
🤓 1
😬 1
🕵🏻 1
😅 1
Well done you
I’ll see if that resolves it
So apparently, I didn't keep up with the changes this time 😄 Just happened to run into it yesterday, because @lastmjs was running into it.
l
So getting rid of the query header is the long term solution?
a
No
Bottom line: One permission file per Type, with named permission queries, that you reference in your project file.
At least, that's the latest proposal
👍 1
But for now, removing the headers just makes it work ™️
👍 1
n
I removed that line but now receive
No CONNECT permissions
. Did anything change for those permission queries? All I’m doing is checking the user is an admin. Nothing special
a
Well, at least your permission queries fire now 😄
Do you have a specific
CONNECT
permission query specified?
n
Yeah
Copy code
- operation: ReportOnMeetingable.*
    authenticated: true
    query: ./permissions/Report.graphql
Report.graphql
Copy code
{
  SomeUserExists(filter: {id: $user_id, admin: true})
}
a
And you are sure you're running this as the correct user?
n
Yeah
Anyway to see all of my permissions from the CLI?
a
Not yet, there's a FR floating around somewhere for that.
n
sorry for the troubles! we'll brush up the per syntax soon and update our examples and docs 🙂