From 1b7a85e28aee47f1fdd3f3221e71a0fd19383d72 Mon Sep 17 00:00:00 2001 From: Tomaz Bratanic Date: Sun, 5 Apr 2020 17:20:10 +0200 Subject: [PATCH 1/2] WiP --- src/appConfigs/schema.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/appConfigs/schema.ts b/src/appConfigs/schema.ts index 69d1034..afa615b 100644 --- a/src/appConfigs/schema.ts +++ b/src/appConfigs/schema.ts @@ -48,6 +48,32 @@ export const typeDefs = gql` ) } + type Place { + _id: ID! + uid: ID! + location: Point! + hasDay: [PlaceDay]! + @cypher( + statement: """ + MATCH (this)-->(day:PlaceDay) + OPTIONAL MATCH (day)<-[:HAS_LOCATION]-(logEntry) + RETURN {date:day.date, visitors:collect(logEntry)} + """ + ) + } + + type PlaceDay { + id: ID! + date: DateTime! + visitorLogs:[LogEntry]! + @cypher( + statement: """ + MATCH (this)<-[:HAS_LOCATION]-(logEntry) + RETURN logEntry + """ + ) + } + input PersonByIdInput { uid: ID! } From 95bb0b63bec6b17dd3a430c59f528897b23d85d0 Mon Sep 17 00:00:00 2001 From: Tomaz Bratanic Date: Sun, 5 Apr 2020 17:55:52 +0200 Subject: [PATCH 2/2] Add name --- src/appConfigs/schema.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/appConfigs/schema.ts b/src/appConfigs/schema.ts index afa615b..889f27e 100644 --- a/src/appConfigs/schema.ts +++ b/src/appConfigs/schema.ts @@ -51,6 +51,7 @@ export const typeDefs = gql` type Place { _id: ID! uid: ID! + name: String! location: Point! hasDay: [PlaceDay]! @cypher(