Skip to content

Commit

Permalink
updated order metafield schema
Browse files Browse the repository at this point in the history
  • Loading branch information
somethingmorerelevant committed Jan 20, 2025
1 parent 99476ff commit 13f6438
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
19 changes: 4 additions & 15 deletions tap_shopify/streams/graphql/gql_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,6 @@ def get_metafield_query_order():
... on PaymentCustomization {
id
}
... on Page {
id
}
... on Order {
id
email
Expand All @@ -508,24 +505,12 @@ def get_metafield_query_order():
... on Image {
id
}
... on GiftCardDebitTransaction {
id
}
... on GiftCardCreditTransaction {
id
}
... on FulfillmentConstraintRule {
id
}
... on AppInstallation {
id
}
... on Article {
id
}
... on Blog {
id
}
... on CartTransform {
id
}
Expand Down Expand Up @@ -562,6 +547,10 @@ def get_metafield_query_order():
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions tap_shopify/streams/metafields.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ class Metafields(ShopifyGqlStream):
"custom_collections":"collections"
}

# required to access correct key from graphql response
# maps object list to single object access key
resource_alias = {
"customers":"customer",
"products":"product",
"collections": "collection"
"collections": "collection",
"orders": "order"
}
# pylint: disable=W0221
def get_query(self):
Expand Down Expand Up @@ -114,7 +117,6 @@ def get_objects(self):
with metrics.http_request_timer(self.name):
response = self.call_api(query_params, query, resource_type)
data = (response.get("metafields") or {})
LOGGER.info("got Data %s", data)
for edge in data.get("edges"):
obj = edge.get("node")
obj = self.transform_object(obj)
Expand Down

0 comments on commit 13f6438

Please sign in to comment.