This is a follow up to the previous tutorial available at https://www.graphifi.com/easygraph-quick-start-search
Next we want to try updating the ‘givenName’ property. Click on the Plus button below the SEARCH request and from the popup menu select ‘Add Update Request’. In the request Name field enter ‘Update givenName of a person’. Your screen should look as below.
We want to update ‘givenName’. In the request body we need to add details about which resource we want to update, its ETag and which properties we want to update.
For more details on how update works please see https://easygraph.graphifi.com/docs/easygraph.html#update
The easiest way to get all the details mentioned above is to copy the person resource details from the ‘Response Body’ section under the response tab of the SEARCH request.
After copying the resource details, paste it into the ‘graph’ property in the ‘Request Body’ section under the Request tab of the UPDATE request. The UPDATE request should look as shown below.
Next, in the UPDATE Request Body, click on the value ‘foo’ to edit it and change it to ‘foobar’.
Also remove ‘type’ property and its value.
The ‘Request Body’ should look as shown below.
Click the SAVE button to save the changes in the UPDATE request.
Click the Play button on the left-hand side of the UPDATE request title bar. You should see a success message in the request title bar and the tab should change to the Response tab. The ‘Response Body’ of the request should look as below.
As shown in the above screenshot EasyGraph has updated the ‘givenName’ of the person and the response also contains the new ETag for the resource. Note that the ‘egETag’ property value might be different for you.
Now let us try to find the updated resource by the updated givenName. As explained in previous posts add a new SEARCH request and enter ‘Find a person with a givenName’ in the Name field.
Click on the Filters tab under the Build tab of the new SEARCH request. As explained in the previous post add two filters by clicking on the ‘ADD FILTERS’ button. Click the SAVE button to save the new SEARCH request. With all the changes your screen should look as below.
Click the Play button on the left-hand side of the SEARCH request title bar. You should see a success message in the request title bar and the tab should change to the Response tab. The ‘Response Body’ of the request should look as below.
As shown in the above screenshot we can see that our search request to find a person by given name is returning one result.
In the search request try to type some other value for givenName property. This should return an empty array for ‘egResults’.
For next tutorial of this series please see https://www.graphifi.com/ easygraph-quick-start-d elete
Copyright © 2024
Graphifi Ltd is a company registered in England and Wales
Company No. 12034454
VAT Registration No. 328 1956 82