cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UPDATE QUERY

AysenurCecen
Contributor

hello, the data is not updated in the update query below, can you help?
Where can I find documentation on APIs?

 

//update
personRequest = new GraphQLRequest
{
Query = @"
mutation updatePersonSystem($id : String!, $name : String, $email : String, $usercode : String, $status : StatusLoginEnum){
updatePersonSystem(id: $id personSystem:{
name: $name,
email: $email,
login: {
action:add,
list:[{name: $usercode, userCode: $usercode, statusLogin: $status}]
}
}){
id,
name,
email,
login {
id,
name,
userCode,
statusLogin
}
}
}",
OperationName = "updatePersonSystem",
Variables = new { id = graphQLResponse.Data.PersonSystem[0].Id, name = PersonList.Name, email = PersonList.Email, usercode = PersonList.Login[0].UserCode, status = PersonList.Login[0].StatusLogin }
};

4 Replies

I looked at the sdl schemas, but I couldn't find the update or delete syntax for login(ex:updateLogin), if there is an example, could you share it?

Hello,

All the documentation is in the link I shared, no more.

As I mentionned login cannot be edited out of the box, so you cannot edit the status.

If you want to edit the login, I suggest you do a syntaxe like that updateLogin(...) instead of updatePersonSystem(...) 

eventhough  you have configured enabling login modification, i'm don't believe you can edit the status once the login is created.

What is the use case you are trying to achieve ?

 

Thanks for the answer I think you misunderstood. I can get the data in the query I threw, and I also performed the insert operation. I mean, is it possible to do something like an edit action, similar to the add action?
How can I edit the $status parameter in the list and do any update for it?

Also, the post in the link you sent belongs to us and  we have examined most of the articles about the api in the forum, apart from that , is there a more comprehensive api documentation about your product?

 

oguimard
Retired

Hello,

The documentation is here https://community.mega.com/t5/REST-API/bd-p/api

Another post that can be of interest for you https://community.mega.com/t5/HOPEX-Forum/HOPEX-V5-API-Integration-createpersonsystem-login-array-in...

Please note that out of the box you cannot create login with the GraphQL API.

This part of the query will not work

login: {
action:add,
list:[{name: $usercode, userCode: $usercode, statusLogin: $status}]
}

Please give details on what is this syntaxe you are using ?

Please give details on the error you get :

  • as the result of the query
  • in the macro log on server side
  • on the megaerr on server side