I have been having an issue where a query that runs without issues on GraphiQL gives an error when executed locally. For instance, when querying media: Local error
The same thing also happens when I attempt to delete items – the destroyProjectMedia mutation causes a No permission to delete Dynamic error locally but not on GraphiQL.
The function I have been using to execute the query locally (and its helper) are below:
I think there are two similar, but different problems:
1 - The query project(id: "3111")... only works correctly on GraphiQL
I tried locally and I could reproduce this, I’ll register the issue.
While this one is not working, could you try this other query? It should return the data you want, but for all the projects on team. You could then get only the data where project dbid is 3111.
Remember to replace team-slug by your team slug:
2 - Permission issue when destroying a Project Media
Team owners can delete any content and team editors can delete only the items created by them.
Could you check what’s the role and status from the user you are using to authenticate, please? And check if the item was created by the same user?
This query shows the role and permission in all teams the authenticated user is associated to:
query {
me {
team_users {
edges {
node {
team {
name
}
role
status
}
}
}
}
}