diff --git a/src/schema.graphql b/src/schema.graphql index 55f23d5ca..95e7b3d48 100644 --- a/src/schema.graphql +++ b/src/schema.graphql @@ -1,6 +1,16 @@ type Query { isLoggedIn: Boolean! statistics: Statistics! + findPosts(filter: String!, limit: Int = 10): [Post]! @cypher( + statement: """ + CALL db.index.fulltext.queryNodes( + 'postTitleAndContent', $filter+'~') + YIELD node AS node + RETURN node + ORDER BY node.createdAt DESC + LIMIT $limit + """ + ) } type Mutation { login(email: String!, password: String!): LoggedInUser