-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fix property graph query statement
- Loading branch information
1 parent
c12c1c2
commit 31932d7
Showing
4 changed files
with
35 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
packages/studio-explore/src/services/cypher/queryPropertyStatics.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import { queryStatement } from './queryStatement'; | ||
export const queryPropertyStatics = async (property: string) => { | ||
export const queryPropertyStatics = async (label: string, property: string) => { | ||
const match = ['year', 'month']; | ||
if (!match.includes(property)) { | ||
return []; | ||
} | ||
|
||
const data = await queryStatement(` | ||
MATCH(a) where a.${property} IS NOT NULL | ||
MATCH(a:${label}) where a.${property} IS NOT NULL | ||
WITH a.${property} AS ${property} | ||
return ${property},COUNT(${property}) as counts | ||
`); | ||
|
||
return data.table; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters