@appinteractive could you have a look if sanitization of search queries
work? I created a test and I see "unterminated string" exceptions. This
is not what we want! All user input should be escaped.
In order to create the indices programmatically we need to change the
default password for security concerns. To create the user we need to
start the neo4j database. So I decided to provide a bash script that
let us do it once the container are started.
In production we must change the NEO4J_PASSWORD.
This was causing a lot of headache on the frontend. Now, there a single
source of truth. If you query `currentUser` you can overwrite your local
copy of the user and update the UI.
This reverts commit d8af7cb2e57b4623baa719c181899f4d72f7b185.
@appinteractive this broke the index page on the frontend side. If you
log in, you don't see posts and instead you see this error on the developer
console:
```
GraphQL error: Invalid input '}': expected whitespace, comment or a property key name (line 4, column 39 (offset: 464))
"RETURN COUNT(r)", {this: post_author, }, false),shoutedCount: apoc.cypher.runFirstColumn("MATCH (this)-[:SHOUTED]->(r:Post) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(r)", {this: post_author, }, false),commentsCount: apoc.cypher.runFirstColumn("MATCH (this)-[:WROTE]->(r:Comment) WHERE NOT r.deleted = true RETURN COUNT(r)", {this: post_author, }, false),followedByCount: apoc.cypher.runFirstColumn("MATCH (this)<-[:FOLLOWS]-(r:User) RETURN COUNT(r)", {this: post_author, }, false),location: head([ post_author_location IN apoc.cypher.runFirstColumn("MATCH (this)-[:IS_IN]->(l:Location) RETURN l", {this: post_author, }, true) | post_author_location { .nameEN }]) ,badges: [(`post_author`)<-[:`REWARDED`]-(`post_author_badges`:`Badge`) | post_author_badges { .id , .key , .icon }] }]) ,commentsCount: apoc.cypher.runFirstColumn("MATCH (this)<-[:COMMENTS]-(r:Comment) RETURN COUNT(r)", {this: post, }, false),categories: [(`post`)-[:`CATEGORIZED`]->(`post_categories`:`Category`) | post_categories { .id , .name , .icon }] ,shoutedCount: apoc.cypher.runFirstColumn("MATCH (this)<-[:SHOUTED]-(r:User) WHERE NOT r.deleted = true AND NOT r.disabled = true RETURN COUNT(r)", {this: post, }, false)} AS `post` SKIP $offset LIMIT $first"
```
The idMiddleware was adding selection fields to the resolveInfo even if
the selection fields were empty. This caused a bug for each resolve
function including
```
{
isLoggedin
}
```
which does not have any additional curly braces after the query.