Skip to content

Instantly share code, notes, and snippets.

@ikwattro
Created November 12, 2019 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikwattro/623c039a51a2e0eb835d1034bafa2dd6 to your computer and use it in GitHub Desktop.
Save ikwattro/623c039a51a2e0eb835d1034bafa2dd6 to your computer and use it in GitHub Desktop.
CREATE (n:HumeAction)
SET n.id = 'hume_action_ins'
SET n.data = '{
  "label": "Ship Product to",
  "returnType": "GRAPH",
  "scope": "LOCAL",
  "id": "hume_action_ins",
  "inputParameters": [
    {
      "id": "country",
      "label": "Select Country",
      "type": "SELECT_ASYNC",
      "required": true,
      "resolver": {
        "type": "CYPHER",
        "params": {
          "query": "CALL db.index.fulltext.queryNodes(\'Country\', $country + \'*\') YIELD node RETURN id(node) AS id, node.name AS value"
        }
      }
    }
  ],
  "action": {
    "statement": "MATCH p=(n)<-[:FOR_PRODUCT]-(order)-[:SHIPS_TO]->(country) WHERE id(n) = $id AND id(country) = $country RETURN p, [{label:\'Insufficient Stock\', level: \'WARNING\'}] AS insights",
    "parameters": {
      "id": {
        "type": "node",
        "resolution": "single"
      }
    }
  }
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment