2025-03-06 - Graph Handler Docs

From Izara Wiki
Revision as of 09:38, 6 March 2025 by Seagame (talk | contribs)
Jump to navigation Jump to search

GraphHandler Function

CreateNode

Request Parameters

  • objType
    • Type : object
    • Required: true
  • objType.objectType
    • Type : string
    • Required : true
  • objType.serviceTag
    • Type : string
    • Required : true
  • objInstanceFull
    • Type : object
    • Required: true
  • objInstanceFull.identifiers
    • Type : string
    • Required : true
  • objInstanceFull.fields
    • Type : object
    • Required: optional
  • settings
    • Type : object
    • Required : optional
  • settings.updatePropertiesOnMatch
    • Type: Boolean // false // true
    • Required : optional
  • originTimestamp
    • Type : date.now() // number
    • Required : optional for create or update
  • relationships
    • Type : array
    • Required : optional for create
  • relationships[item]
    • Type : object
    • Required: optional
  • relationships[item].relType
    • Type : object
    • Required: optional
  • relationships[item].relationshipProperties
    • Type : object
    • Required: optional
  • relationships[item].relationshipDirection
    • Type : string
    • Required: true
  • relationships[item].targetIdentifiers
    • Type : object
    • Required: true
  • callingFlowConfig
    • Type: object
    • Required : optional
  • callingFlowConfig.callingFlow
    • Type: string
    • Required : optional

Request Example

{
  "objType": {
    "objectType": string,
    "serviceTag": string
  },
  "objInstanceFull": {
    "identifiers": {
      // ...identifier
    },
    "fields": {
      // ...fields
    }
  },
  "relationships": [
    {
      "relType": {
        "serviceTag": string,
        "relationshipTag": string
      },
      "relationshipProperties": {
        //... key and value of targetIdentifiers
      },
   	  "relationshipDirection": string, // "from" | "to"
      "targetObjType": {
        "serviceTag": string,
        "objectType": string
      },
      "targetIdentifiers": {
        //... targetIdentifiers
      }
    }
  ],
  "originTimestamp": number,    // timestamp when create
  "settings": { 
   "updatePropertiesOnMatch": boolean  // default=false
  },
  "callingFlow": string,
  "callingFlowProperties": object,
}

Output Response

  • returnValue
    • Type: object
  • returnValue.queryResult
    • Type: object
    • Description: data from created node
  • queryResult.objTypes
    • Type: array
    • Description: serviceTag and objectType
  • queryResult.exitsNode
    • Type: object
  • queryResult.userNode
    • Type: object
    • Description: return user's created.
  • queryResult.additionalReturn
  • Type: object
    • Description: data from targetNode
  • queryResult.relationships
    • Type: array
    • Description: data from relationships in targetNode
  • returnValue.objType
    • Type: object
  • returnValue.objInstanceFull
  • Type: object
    • Description: data in graph
  • returnValue.objInstanceFull.identifiers
    • Type: object
    • Description: Id has properties Key
  • returnValue.objInstanceFull.fields
    • Type: object
    • Description: data properties in graph
  • returnValue.relationships
    • Type: array
    • Description: data from relationships that create node to targetNode
  • returnValue.settings
    • Type: object
  • returnValue.Status
    • Type: string
    • Description: Status from create node. Return "error" or "complete".
  • returnValue.errorsFound
    • Type: array
  • returnValue.graphServiceTag
    • Type: string

Return Example

{
  "returnValue": {
    "queryResult": {
      "objTypes": [
        {
          "serviceTag": "xxx",
          "objectType": "yyy"
        }
      ],
      "objInstanceFull": {
        "identifiers": {
          "id": "zzz"
        },
        "fields": { "xxx": "yyy" }
      },
      "existsNode": {},
      "userNode": {
        "objTypes": [
          {
            "serviceTag": "UserAccount",
            "objectType": "user"
          }
        ],
        "properties": {
          "id": "xxx"
        }
      },
      "additionalReturn": {
        "targetNode0": {
          "objTypes": [
            {
              "serviceTag": "xxx",
              "objectType": "yyy"
            }
          ],
          "properties": {"xxx": "yyy" }
        }
      },
      "relationships": [
        {
          "relType": {
            "serviceTag": "xxx",
            "relationshipTag": "yyy"
          },
          "relationshipProperties": {}
        }
      ]
    },
    "objType": {
      "objectType": "xxx",
      "serviceTag": "yyy"
    },
    "objInstanceFull": {
      "identifiers": {
        "id": "zzz"
      },
      "fields": {"xxx": "yyy"}
    },
    "relationships": [
      {
        "relType": {
          "serviceTag": "xxx",
          "relationshipTag": "yyy"
        },
        "relationshipProperties": {"xxx": "yyy"},
        "targetObjType": {
          "serviceTag": "xxx",
          "objectType": "yyy"
        },
        "targetIdentifiers": {
          "id": "zzz"
        }
      }
    ],
    "settings": {}
  },
  "status": "complete",
  "errorsFound": [],
  "graphServiceTag": "GraphHandler"
 }