Move thread parser dispatching into _client.py

I know, it's not pretty, but it doesn't belong in _graphql.py either
This commit is contained in:
Mads Marquart
2019-03-10 19:39:22 +01:00
parent e579e0c767
commit 1f961b2ca7
3 changed files with 12 additions and 17 deletions

View File

@@ -82,19 +82,6 @@ def graphql_to_message(message):
return rtn
def graphql_to_thread(thread):
if thread["thread_type"] == "GROUP":
return Group._from_graphql(thread)
elif thread["thread_type"] == "ONE_TO_ONE":
return User._from_thread_fetch(thread)
else:
raise FBchatException(
"Unknown thread type: {}, with data: {}".format(
thread.get("thread_type"), thread
)
)
def graphql_queries_to_json(*queries):
"""
Queries should be a list of GraphQL objects