Skip to content

Commit

Permalink
Add graphql method
Browse files Browse the repository at this point in the history
  • Loading branch information
gcandal committed Apr 14, 2020
1 parent d634023 commit 658ce1c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/shopify/base.py
Expand Up @@ -117,6 +117,11 @@ def get_many(self, url, key = None, **kwargs):
if key: result = {key : result}
return result

def graphql(self, query_data):
url = self.base_url + "admin/api/2020-01/graphql.json"
contents = self.post(url = url, data = query_data, headers = { "Content-Type": "application/graphql" })
return contents

def _build_url(self):
if not self.api_key:
raise appier.OperationalError(message = "No API key provided")
Expand Down

0 comments on commit 658ce1c

Please sign in to comment.