2025-03-27 Graph Use Case/CreateNode: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
Line 27: Line 27:


</source>
</source>
'''Output'''
'''Example Output'''
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
{
{
Line 57: Line 57:


=== CreateNode with versionedData ===
=== CreateNode with versionedData ===
* Example param
'''Example Param'''
<source lang="json">
 
</source>
'''Exmaple Output'''
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">


Line 72: Line 76:


=== CreateNode with targetNode ===
=== CreateNode with targetNode ===
* Example param
'''Example Param'''
<source lang="json">
 
</source>
'''Exmaple Output'''
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">



Revision as of 09:44, 21 April 2025

CreateNode Function

Overview

Using Case

CreateNode with identifiers

Example Param

{
 "objType":{
    "serviceTag": "xxxx",
    "objectType": "yyyy",
 },
 "objInstanceFull":{
    "identifiers":{
       "xxxx" : "yyyy"
    },
    "fields":{
      // "optional"
      "xxxx" : "yyyy"
    }
 },
"relationships":[],
 "originTimestamp": 1234567890,
 "settings":{
    "updatePropertiesOnMatch": false 
 }
}

Example Output

{
 returnValue: {
   queryResult: {
     createdNode: {
       objType: {
         serviceTag: 'xxxx',
           objectType: 'yyyy'
       },
       properties: { //properties }
     },
     existsNode: null,
       userNode: {
       objType: { serviceTag: 'UserAccount', objectType: 'user' },
       properties: { userId: 'xxxx' }
     }
   },
   objType: { objectType: 'xxxx', serviceTag: 'yyyy' },
   objInstanceFull: {
     identifiers: { xxxx: 'yyyy' },
     fields: { // fields properties }
   },
   relationships: [],
     settings: { updatePropertiesOnMatch: false }
 }
}

CreateNode with versionedData

Example Param

Exmaple Output

CreateNode with belongTo

  • Params like create basicNode & versionedData but in objectSchema optional has belongTo If in objectSchema have belongTo will create query and return dataStructure of belongTo
  • Must send : x-correlation-base-user-id : xxxx AND x-correlation-target-id : yyyy ( identifiers of that node)

CreateNode with extendObjtype

  • create objectSchema that have objectType for create main node eg. objectType: objectA then upload To S3
  • create objectSchemathat have extendObjtype for existParentNode eg. objectType: objectB then upload To S3
  • Send parameter with identifiers’s objectType of extendObjtype for create Node

CreateNode with targetNode

Example Param

Exmaple Output