Skip to content

Commit

Permalink
Merge pull request #366 from kaushalvivek/master
Browse files Browse the repository at this point in the history
Fix for issue #365
  • Loading branch information
madsmtm authored Dec 10, 2018
2 parents f8d3b57 + 13bfc5f commit 2f8d072
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions fbchat/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ def fetchAllUsers(self):

return users

def searchForUsers(self, name, limit=1):
def searchForUsers(self, name, limit=10):
"""
Find and get user by his/her name
Expand All @@ -517,7 +517,7 @@ def searchForUsers(self, name, limit=1):

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 2f8d072

Please sign in to comment.