simplefied cypher, cleanDatabase after specs

This commit is contained in:
Moriz Wahl 2020-10-14 15:26:00 +02:00
parent 3ba72526b9
commit 106e2713d6
2 changed files with 3 additions and 3 deletions

View File

@ -3,8 +3,8 @@ export default {
userData: async (object, args, context, resolveInfo) => {
const id = context.user.id
const cypher = `
MATCH (u:User { id: $id })
WITH u AS user
MATCH (user:User { id: $id })
WITH user
OPTIONAL MATCH (p:Post)
WHERE (p)<-[:COMMENTS]-(:Comment)<-[:WROTE]-(user)
OR (user)-[:WROTE]->(p)

View File

@ -35,7 +35,7 @@ beforeAll(async () => {
})
afterAll(async () => {
// await cleanDatabase()
await cleanDatabase()
})
const userDataQuery = gql`