From 13bfc5f2f9a0c150189bbd0040ffa57ab01e9d22 Mon Sep 17 00:00:00 2001 From: kaushalvivek Date: Mon, 10 Dec 2018 14:46:04 +0530 Subject: [PATCH] Fix for search limit --- fbchat/client.py | 6 +++--- fbchat/graphql.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fbchat/client.py b/fbchat/client.py index 90469c28..e36d1cc1 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -517,7 +517,7 @@ def searchForUsers(self, name, limit=10): return [graphql_to_user(node) for node in j[name]['users']['nodes']] - def searchForPages(self, name, limit=1): + def searchForPages(self, name, limit=10): """ Find and get page by its name @@ -531,7 +531,7 @@ def searchForPages(self, name, limit=1): return [graphql_to_page(node) for node in j[name]['pages']['nodes']] - def searchForGroups(self, name, limit=1): + def searchForGroups(self, name, limit=10): """ Find and get group thread by its name @@ -546,7 +546,7 @@ def searchForGroups(self, name, limit=1): return [graphql_to_group(node) for node in j['viewer']['groups']['nodes']] - def searchForThreads(self, name, limit=1): + def searchForThreads(self, name, limit=10): """ Find and get a thread by its name diff --git a/fbchat/graphql.py b/fbchat/graphql.py index 8fc8b6eb..510e93b9 100644 --- a/fbchat/graphql.py +++ b/fbchat/graphql.py @@ -477,7 +477,7 @@ def __init__(self, query=None, doc_id=None, params=None): """ SEARCH_USER = """ - Query SearchUser( = '', = 1) { + Query SearchUser( = '', = 10) { entities_named() { search_results.of_type(user).first() as users { nodes { @@ -489,7 +489,7 @@ def __init__(self, query=None, doc_id=None, params=None): """ + FRAGMENT_USER SEARCH_GROUP = """ - Query SearchGroup( = '', = 1, = 32) { + Query SearchGroup( = '', = 10, = 32) { viewer() { message_threads.with_thread_name().last() as groups { nodes { @@ -501,7 +501,7 @@ def __init__(self, query=None, doc_id=None, params=None): """ + FRAGMENT_GROUP SEARCH_PAGE = """ - Query SearchPage( = '', = 1) { + Query SearchPage( = '', = 10) { entities_named() { search_results.of_type(page).first() as pages { nodes { @@ -513,7 +513,7 @@ def __init__(self, query=None, doc_id=None, params=None): """ + FRAGMENT_PAGE SEARCH_THREAD = """ - Query SearchThread( = '', = 1) { + Query SearchThread( = '', = 10) { entities_named() { search_results.first() as threads { nodes {