fix broken query due to outdated query format

This commit is contained in:
Ulf Gebhardt 2023-05-15 23:55:52 +02:00
parent ea631f259c
commit b449459b09
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -319,7 +319,7 @@ export default {
email: async (parent, params, context, resolveInfo) => {
if (typeof parent.email !== 'undefined') return parent.email
const { id } = parent
const statement = `MATCH(u:User {id: {id}})-[:PRIMARY_EMAIL]->(e:EmailAddress) RETURN e`
const statement = `MATCH(u:User {id: $id})-[:PRIMARY_EMAIL]->(e:EmailAddress) RETURN e`
const result = await neode.cypher(statement, { id })
const [{ email }] = result.records.map((r) => r.get('e').properties)
return email