Merge pull request #366 from kaushalvivek/master

Fix for issue #365
This commit is contained in:
Mads Marquart
2018-12-10 21:16:57 +01:00
committed by GitHub
2 changed files with 8 additions and 8 deletions

View File

@@ -502,7 +502,7 @@ class Client(object):
return users return users
def searchForUsers(self, name, limit=1): def searchForUsers(self, name, limit=10):
""" """
Find and get user by his/her name Find and get user by his/her name
@@ -517,7 +517,7 @@ class Client(object):
return [graphql_to_user(node) for node in j[name]['users']['nodes']] 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 Find and get page by its name
@@ -531,7 +531,7 @@ class Client(object):
return [graphql_to_page(node) for node in j[name]['pages']['nodes']] 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 Find and get group thread by its name
@@ -546,7 +546,7 @@ class Client(object):
return [graphql_to_group(node) for node in j['viewer']['groups']['nodes']] 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 Find and get a thread by its name

View File

@@ -477,7 +477,7 @@ class GraphQL(object):
""" """
SEARCH_USER = """ SEARCH_USER = """
Query SearchUser(<search> = '', <limit> = 1) { Query SearchUser(<search> = '', <limit> = 10) {
entities_named(<search>) { entities_named(<search>) {
search_results.of_type(user).first(<limit>) as users { search_results.of_type(user).first(<limit>) as users {
nodes { nodes {
@@ -489,7 +489,7 @@ class GraphQL(object):
""" + FRAGMENT_USER """ + FRAGMENT_USER
SEARCH_GROUP = """ SEARCH_GROUP = """
Query SearchGroup(<search> = '', <limit> = 1, <pic_size> = 32) { Query SearchGroup(<search> = '', <limit> = 10, <pic_size> = 32) {
viewer() { viewer() {
message_threads.with_thread_name(<search>).last(<limit>) as groups { message_threads.with_thread_name(<search>).last(<limit>) as groups {
nodes { nodes {
@@ -501,7 +501,7 @@ class GraphQL(object):
""" + FRAGMENT_GROUP """ + FRAGMENT_GROUP
SEARCH_PAGE = """ SEARCH_PAGE = """
Query SearchPage(<search> = '', <limit> = 1) { Query SearchPage(<search> = '', <limit> = 10) {
entities_named(<search>) { entities_named(<search>) {
search_results.of_type(page).first(<limit>) as pages { search_results.of_type(page).first(<limit>) as pages {
nodes { nodes {
@@ -513,7 +513,7 @@ class GraphQL(object):
""" + FRAGMENT_PAGE """ + FRAGMENT_PAGE
SEARCH_THREAD = """ SEARCH_THREAD = """
Query SearchThread(<search> = '', <limit> = 1) { Query SearchThread(<search> = '', <limit> = 10) {
entities_named(<search>) { entities_named(<search>) {
search_results.first(<limit>) as threads { search_results.first(<limit>) as threads {
nodes { nodes {