Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
== Unreleased

- Replace `print` with `logging` ([#678](https://github.com/Shopify/shopify_python_api/issues/678))

== Version 12.3.0

- Update API version with 2023-04 release ([#649](https://github.com/Shopify/shopify_python_api/pull/649))
Expand Down
7 changes: 5 additions & 2 deletions shopify/resources/graphql.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import logging

import shopify
from ..base import ShopifyResource
from six.moves import urllib
import json

logger = logging.getLogger(__name__)


class GraphQL:
def __init__(self):
Expand All @@ -27,6 +31,5 @@ def execute(self, query, variables=None, operation_name=None):
response = urllib.request.urlopen(req)
return response.read().decode("utf-8")
except urllib.error.HTTPError as e:
print((e.read()))
print("")
logger.exception("GraphQL error response:\n%s" % e.read())
raise e