Skip to content

Commit

Permalink
Fix for search limit
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalvivek committed Dec 10, 2018
1 parent d32b7b6 commit 13bfc5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions fbchat/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions fbchat/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def __init__(self, query=None, doc_id=None, params=None):
"""

SEARCH_USER = """
Query SearchUser(<search> = '', <limit> = 1) {
Query SearchUser(<search> = '', <limit> = 10) {
entities_named(<search>) {
search_results.of_type(user).first(<limit>) as users {
nodes {
Expand All @@ -489,7 +489,7 @@ def __init__(self, query=None, doc_id=None, params=None):
""" + FRAGMENT_USER

SEARCH_GROUP = """
Query SearchGroup(<search> = '', <limit> = 1, <pic_size> = 32) {
Query SearchGroup(<search> = '', <limit> = 10, <pic_size> = 32) {
viewer() {
message_threads.with_thread_name(<search>).last(<limit>) as groups {
nodes {
Expand All @@ -501,7 +501,7 @@ def __init__(self, query=None, doc_id=None, params=None):
""" + FRAGMENT_GROUP

SEARCH_PAGE = """
Query SearchPage(<search> = '', <limit> = 1) {
Query SearchPage(<search> = '', <limit> = 10) {
entities_named(<search>) {
search_results.of_type(page).first(<limit>) as pages {
nodes {
Expand All @@ -513,7 +513,7 @@ def __init__(self, query=None, doc_id=None, params=None):
""" + FRAGMENT_PAGE

SEARCH_THREAD = """
Query SearchThread(<search> = '', <limit> = 1) {
Query SearchThread(<search> = '', <limit> = 10) {
entities_named(<search>) {
search_results.first(<limit>) as threads {
nodes {
Expand Down

0 comments on commit 13bfc5f

Please sign in to comment.