graphQL "users" query: "AUTH_NOT_AUTHORIZED"

Trying to run a graphQL “users” query I receive a “AUTH_NOT_AUTHORIZED” error.
Running an “interviews” query works fine!

So I thought this may be due to having access only to a specific workspace.
So I tried to restrict my query to this workspace in a “where” phrase:

(where: {
isLocked: {eq: false}
workspaces: {eq: [“myworkspace”]}
})

But apparently I cannot use “workspaces” for filtering, because I get an error:

“The specified input object field workspaces does not exist.”

Hello Klaus,

you get

  • AUTH_NOT_AUTHENTICATED when the system does not recognize you as a user based on the login+password combination that you’ve supplied;
  • AUTH_NOT_AUTHORIZED when the system recognizes you as a user, but determined that you have no access to a certain resource. This could be because of the role, or workspace.

When I try with the Admin account I get the list:

Now, you are right that filtering on the workspace doesn’t work, because the workspace is not included.

What you could do now, is, perhaps, read the full list of the users (including their workspaces) under the admin account, then filter it out by workspace name and send it down for consumption. If the workspace assignments don’t change (users stay within a certain workspace for life) then it is even better.

Remember that workspaces may indicate multiple workspaces. So treating it with “eq” or “neq” is only good when you are sure you assign each user to only one workspace.

Hello Sergiy,

Thanks for your reply.
The workaround you suggest (running the query as admin) is not very practical in my case, because I am running the query under program control as an APIuser with access only to one workspace.
As such the graphQL “users” query is not accessible to me at all. I don’t think this is what should happen.
Adding a field “workspaces” for filtering would resolve the problem in the most natural way.

My workaround is using the standard API endpoint “supervisors” to get a list of supervisors and then the
“interviewers” endpoint to get the interviewers for each supervisor and concatenate the results.
I can live with that, but still think the graphQL users query should be capable of getting this list.

You are right. Since the workspaces are an array, “in” would be the correct operator…