-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Description
Node Version
v21.7.3
NPM/Yarn/PNPM Version
10.5.0
Strapi Version
5.6.0
Operating System
Windows 11
Database
MySQL
Javascript or Typescript
Typescript
Reproduction URL
No response
Bug Description
When I try to perform a mutation of an user using the userPermissionPlugin like :
mutation UpdateUsersPermissionsUser($updateUsersPermissionsUserId: ID!, $data: UsersPermissionsUserInput!) {
updateUsersPermissionsUser(id: $updateUsersPermissionsUserId, data: $data) {
data {
confirmed
username
}
}
}with these variables it doesn't work, I get a not found error:
{
"updateUsersPermissionsUserId": documentID-OfAnUser, // e.g. "g1234o33xzjghhz9obw0brhy"
"data": {
"relation": [documentID-OfAnEntryOfTheRelationalField], // e.g. "g1234o33xzjghqssdbw0brhy"
}
}but with these it does
{
"updateUsersPermissionsUserId": ID-OfAnUser, // e.g. 1
"data": {
"relation": [ID-OfAnEntryOfTheRelationalField], // e.g. 3
}
}The problem is that I can't get the id of the relational field entry with graphQL as only the documentId is exposed via the api.
Steps to Reproduce
- Create a User role
- Create a Collection type - for example "allergies"
- Add a relational field between the two, user has many allergies
- Add some entries to the allergies collection type
- Try to add new entries to the user relational field via graphQL
Expected Behavior
I expect the graphql mutation to work with documentsIds
Logs
{
"errors": [
{
"message": "Internal Server Error",
"extensions": {
"error": {
"name": "NotFoundError",
"message": "User not found",
"details": {}
},
"code": "INTERNAL_SERVER_ERROR"
}
}
],
"data": null
}
Code Snippets
No response
Media
No response
Additional information
No response
Confirmation Checklist
- I have checked the existing issues for duplicates.
- I agree to follow this project's Code of Conduct.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done