Skip to content

Commit 63b4cf4

Browse files
authored
move webhook to its own folder and change the graphql queries into a string in .py file (#151)
1 parent 0eca48d commit 63b4cf4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spylib/webhook.py renamed to spylib/webhook/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
from enum import Enum
2-
from pathlib import Path
32
from typing import List, Optional, Union
43

54
from pydantic import BaseModel
65

76
from spylib.admin_api import OfflineTokenABC
87
from spylib.exceptions import ShopifyGQLUserError
98
from spylib.hmac import validate as validate_hmac
10-
11-
WEBHOOK_CREATE_GQL = Path('./spylib/webhook.graphql').read_text()
9+
from spylib.webhook.graphql_queries import WEBHOOK_CREATE_GQL
1210

1311

1412
class WebhookTopic(Enum):

spylib/webhook.graphql renamed to spylib/webhook/graphql_queries.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
WEBHOOK_CREATE_GQL = """
12
mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {
23
webhookSubscriptionCreate(topic: $topic, webhookSubscription: $webhookSubscription) {
34
webhookSubscription {
@@ -52,3 +53,4 @@
5253
}
5354
}
5455
}
56+
"""

0 commit comments

Comments
 (0)