From 4f8f0debbee1b766aa7c49d8212f97bc1d66ae05 Mon Sep 17 00:00:00 2001 From: Grzegorz Leoniec Date: Wed, 13 Feb 2019 16:02:25 +0100 Subject: [PATCH] Added findPost query --- src/schema.graphql | 10 ++++++++++ 1 file changed, 10 insertions(+) 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