Spaces:
Paused
Paused
Update graphql to one line
Browse files
app.py
CHANGED
|
@@ -60,38 +60,7 @@ def request_product_id(shop_domain, product_key, url):
|
|
| 60 |
"productKey": f"{product_key}",
|
| 61 |
"apiVersion": 1,
|
| 62 |
},
|
| 63 |
-
"query": "
|
| 64 |
-
errorCode
|
| 65 |
-
parentID
|
| 66 |
-
defaultChild
|
| 67 |
-
children {
|
| 68 |
-
productID
|
| 69 |
-
}
|
| 70 |
-
__typename
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
-
query PDPGetLayoutQuery($shopDomain: String, $productKey: String, $layoutID: String, $apiVersion: Float, $userLocation: pdpUserLocation, $extParam: String, $tokonow: pdpTokoNow, $deviceID: String) {
|
| 74 |
-
pdpGetLayout(shopDomain: $shopDomain, productKey: $productKey, layoutID: $layoutID, apiVersion: $apiVersion, userLocation: $userLocation, extParam: $extParam, tokonow: $tokonow, deviceID: $deviceID) {
|
| 75 |
-
requestID
|
| 76 |
-
name
|
| 77 |
-
pdpSession
|
| 78 |
-
basicInfo {
|
| 79 |
-
id: productID
|
| 80 |
-
}
|
| 81 |
-
components {
|
| 82 |
-
name
|
| 83 |
-
type
|
| 84 |
-
position
|
| 85 |
-
data {
|
| 86 |
-
...ProductVariant
|
| 87 |
-
__typename
|
| 88 |
-
}
|
| 89 |
-
__typename
|
| 90 |
-
}
|
| 91 |
-
__typename
|
| 92 |
-
}
|
| 93 |
-
}
|
| 94 |
-
""",
|
| 95 |
}
|
| 96 |
|
| 97 |
headers = {
|
|
|
|
| 60 |
"productKey": f"{product_key}",
|
| 61 |
"apiVersion": 1,
|
| 62 |
},
|
| 63 |
+
"query": "fragment ProductVariant on pdpDataProductVariant { errorCode parentID defaultChild children { productID } __typename } query PDPGetLayoutQuery($shopDomain: String, $productKey: String, $layoutID: String, $apiVersion: Float, $userLocation: pdpUserLocation, $extParam: String, $tokonow: pdpTokoNow, $deviceID: String) { pdpGetLayout(shopDomain: $shopDomain, productKey: $productKey, layoutID: $layoutID, apiVersion: $apiVersion, userLocation: $userLocation, extParam: $extParam, tokonow: $tokonow, deviceID: $deviceID) { requestID name pdpSession basicInfo { id: productID } components { name type position data { ...ProductVariant __typename } __typename } __typename } }",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
}
|
| 65 |
|
| 66 |
headers = {
|