Changer le propriétaire d’une story
Désignez un autre utilisateur comme propriétaire d’une story avec la mutation storyChangeOwner.
Vous avez besoin de l’identifiant GraphQL de la story (voir Lire une story) et de l’identifiant GraphQL du nouveau propriétaire.
La mutation :
mutation changeOwner($input: StoryChangeOwnerInput!) {
storyChangeOwner(input: $input) {
story {
id
user {
id
name
}
}
errors {
__typename
... on MutationError {
path
}
}
}
}
Les variables :
{
"input": {
"id": "STORY_ID",
"owner": "OWNER_ID"
}
}
La réponse confirme le nouveau propriétaire :
{
"data": {
"storyChangeOwner": {
"story": {
"id": "STORY_ID",
"user": {
"id": "OWNER_ID",
"name": "Jane Doe"
}
},
"errors": null
}
}
}