Skip to content

Commit

Permalink
Fix #633 - Support _class as a node label property
Browse files Browse the repository at this point in the history
We currently support `_type` as a node label property
for entities that are created by the Neo4j store. In
order to perform more abstract queries, we also need
to add `_class`.

Example query by `_type`:

```cy
MATCH (account:github_account)-[OWNS]->
  (repo:github_repo)-[ALLOWS]->
  (user:github_user {
    role:"OUTSIDE"
  })
RETURN account, repo, user
```

Example query by `_class`:

```cy
MATCH (account:Account)-[OWNS]->
  (repo:CodeRepo)-[ALLOWS]->
  (user:User {
    role:"OUTSIDE"
  })
RETURN account, repo, user
```
  • Loading branch information
austinkelleher committed Feb 20, 2022
1 parent 1504c54 commit cf714f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/integration-sdk-cli/src/neo4j/neo4jGraphStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export class Neo4jGraphStore {
const buildCommand = `
MERGE (${nodeAlias} {_key: $finalKeyValue, _integrationInstanceID: $integrationInstanceID})
SET ${nodeAlias} += $propertyParameters
SET ${nodeAlias}:${entity._type};`;
SET ${nodeAlias}:${entity._type}
SET ${nodeAlias}:${entity._class};`;
await this.runCypherCommand(buildCommand, {
propertyParameters: propertyParameters,
finalKeyValue: finalKeyValue,
Expand Down

0 comments on commit cf714f9

Please sign in to comment.