Coverage for mindsdb / integrations / handlers / shopify_handler / models / products.py: 0%
40 statements
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-21 00:36 +0000
« prev ^ index » next coverage.py v7.13.1, created at 2026-01-21 00:36 +0000
1from .common import (
2 AliasesEnum,
3 Count,
4 TaxonomyCategory,
5 CollectionConnection,
6 ProductCompareAtPriceRange,
7 ProductPriceRangeV2,
8 SEO,
9)
10from .utils import Nodes
13class Products(AliasesEnum):
14 """A class to represent a Shopify GraphQL product.
15 Reference: https://shopify.dev/docs/api/admin-graphql/latest/objects/Product
16 Require `read_products` permission.
17 """
19 availablePublicationsCount = Count
20 # bundleComponents
21 category = TaxonomyCategory
22 collections = Nodes(CollectionConnection)
23 # combinedListing = CombinedListing
24 combinedListingRole = "combinedListingRole"
25 compareAtPriceRange = ProductCompareAtPriceRange
26 # contextualPricing = ProductContextualPricing # require context
27 createdAt = "createdAt"
28 # defaultCursor = "defaultCursor"
29 description = "description"
30 descriptionHtml = "descriptionHtml"
31 # events = Nodes(EventConnection)
32 # featuredMedia = Media
33 # feedback = ResourceFeedback
34 giftCardTemplateSuffix = "giftCardTemplateSuffix"
35 handle = "handle"
36 hasOnlyDefaultVariant = "hasOnlyDefaultVariant"
37 hasOutOfStockVariants = "hasOutOfStockVariants"
38 hasVariantsThatRequiresComponents = "hasVariantsThatRequiresComponents"
39 id = "id"
40 # inCollection = "inCollection" # require id
41 isGiftCard = "isGiftCard"
42 legacyResourceId = "legacyResourceId"
43 # media = Nodes(MediaConnection)
44 mediaCount = Count
45 # metafield = Metafield # require key
46 # metafields = Nodes(MetafieldConnection)
47 onlineStorePreviewUrl = "onlineStorePreviewUrl"
48 onlineStoreUrl = "onlineStoreUrl"
49 # options = List(ProductOption)
50 priceRangeV2 = ProductPriceRangeV2
51 # productComponents = Nodes(ProductComponentType)
52 productComponentsCount = Count
53 # productParents = Nodes(Product)
54 productType = "productType"
55 publishedAt = "publishedAt"
56 # # publishedInContext = "publishedInContext" # require context
57 # publishedOnCurrentPublication = "publishedOnCurrentPublication" # raise error if publication not exists
58 # publishedOnPublication = "publishedOnPublication" # require id
59 requiresSellingPlan = "requiresSellingPlan"
60 # resourcePublicationOnCurrentPublication = ResourcePublicationV2
61 # resourcePublications = Nodes(ResourcePublication)
62 resourcePublicationsCount = Count
63 # resourcePublicationsV2 = Nodes(ResourcePublicationV2)
64 # restrictedForResource = RestrictedForResource(calculatedOrderIdcalculatedOrderId=!required)
65 # sellingPlanGroups = Nodes(SellingPlanGroupConnection)
66 sellingPlanGroupsCount = Count
67 seo = SEO
68 status = "status"
69 tags = "tags"
70 templateSuffix = "templateSuffix"
71 title = "title"
72 totalInventory = "totalInventory"
73 tracksInventory = "tracksInventory"
74 # translations = Translation(locale=!required)
75 # unpublishedPublications = Nodes(Publication)
76 updatedAt = "updatedAt"
77 # variants = Nodes(ProductVariant)
78 variantsCount = Count
79 vendor = "vendor"
82columns = [
83 {
84 "TABLE_NAME": "products",
85 "COLUMN_NAME": "availablePublicationsCount",
86 "DATA_TYPE": "JSON",
87 "COLUMN_DESCRIPTION": "The number of publications that a resource is published to, without feedback errors.",
88 "IS_NULLABLE": None,
89 },
90 # {
91 # "TABLE_NAME": "products",
92 # "COLUMN_NAME": "bundleComponents",
93 # "DATA_TYPE": "JSON",
94 # "COLUMN_DESCRIPTION": "A list of components that are associated with a product in a bundle.",
95 # "IS_NULLABLE": False
96 # },
97 {
98 "TABLE_NAME": "products",
99 "COLUMN_NAME": "category",
100 "DATA_TYPE": "JSON",
101 "COLUMN_DESCRIPTION": "The category of a product from Shopify's Standard Product Taxonomy.",
102 "IS_NULLABLE": None,
103 },
104 {
105 "TABLE_NAME": "products",
106 "COLUMN_NAME": "collections",
107 "DATA_TYPE": "JSON",
108 "COLUMN_DESCRIPTION": "A list of collections that include the product.",
109 "IS_NULLABLE": False,
110 },
111 # {
112 # "TABLE_NAME": "products",
113 # "COLUMN_NAME": "combinedListing",
114 # "DATA_TYPE": "JSON",
115 # "COLUMN_DESCRIPTION": "A special product type that combines separate products from a store into a single product listing. Combined listings are connected by a shared option, such as color, model, or dimension.",
116 # "IS_NULLABLE": None
117 # },
118 {
119 "TABLE_NAME": "products",
120 "COLUMN_NAME": "combinedListingRole",
121 "DATA_TYPE": "TEXT",
122 "COLUMN_DESCRIPTION": "The role of the product in a combined listing. If null, then the product isn't part of any combined listing.",
123 "IS_NULLABLE": None,
124 },
125 {
126 "TABLE_NAME": "products",
127 "COLUMN_NAME": "compareAtPriceRange",
128 "DATA_TYPE": "JSON",
129 "COLUMN_DESCRIPTION": "The compare-at price range of the product in the shop's default currency.",
130 "IS_NULLABLE": None,
131 },
132 # {
133 # "TABLE_NAME": "products",
134 # "COLUMN_NAME": "contextualPricing",
135 # "DATA_TYPE": "JSON",
136 # "COLUMN_DESCRIPTION": "The pricing that applies to a customer in a specific context. For example, a price might vary depending on the customer's location. Only active markets are considered in the price resolution.",
137 # "IS_NULLABLE": False
138 # },
139 {
140 "TABLE_NAME": "products",
141 "COLUMN_NAME": "createdAt",
142 "DATA_TYPE": "TEXT",
143 "COLUMN_DESCRIPTION": "The date and time when the product was created.",
144 "IS_NULLABLE": False,
145 },
146 # {
147 # "TABLE_NAME": "products",
148 # "COLUMN_NAME": "defaultCursor",
149 # "DATA_TYPE": "TEXT",
150 # "COLUMN_DESCRIPTION": "A default cursor that returns the single next record, sorted ascending by ID.",
151 # "IS_NULLABLE": False
152 # },
153 {
154 "TABLE_NAME": "products",
155 "COLUMN_NAME": "description",
156 "DATA_TYPE": "TEXT",
157 "COLUMN_DESCRIPTION": "A single-line description of the product, with HTML tags removed.",
158 "IS_NULLABLE": False,
159 },
160 {
161 "TABLE_NAME": "products",
162 "COLUMN_NAME": "descriptionHtml",
163 "DATA_TYPE": "TEXT",
164 "COLUMN_DESCRIPTION": "The description of the product, with HTML tags. For example, the description might include bold and italic text.",
165 "IS_NULLABLE": False,
166 },
167 # {
168 # "TABLE_NAME": "products",
169 # "COLUMN_NAME": "events",
170 # "DATA_TYPE": "JSON",
171 # "COLUMN_DESCRIPTION": "The paginated list of events associated with the host subject.",
172 # "IS_NULLABLE": False
173 # },
174 # {
175 # "TABLE_NAME": "products",
176 # "COLUMN_NAME": "featuredMedia",
177 # "DATA_TYPE": "JSON",
178 # "COLUMN_DESCRIPTION": "The featured media associated with the product.",
179 # "IS_NULLABLE": None
180 # },
181 # {
182 # "TABLE_NAME": "products",
183 # "COLUMN_NAME": "feedback",
184 # "DATA_TYPE": "JSON",
185 # "COLUMN_DESCRIPTION": "The information that lets merchants know what steps they need to take to make sure that the app is set up correctly. For example, if a merchant hasn't set up a product correctly in the app, then the feedback might include a message that says You need to add a price to this product.",
186 # "IS_NULLABLE": None
187 # },
188 {
189 "TABLE_NAME": "products",
190 "COLUMN_NAME": "giftCardTemplateSuffix",
191 "DATA_TYPE": "TEXT",
192 "COLUMN_DESCRIPTION": "The theme template that's used when customers view the gift card in a store.",
193 "IS_NULLABLE": None,
194 },
195 {
196 "TABLE_NAME": "products",
197 "COLUMN_NAME": "handle",
198 "DATA_TYPE": "TEXT",
199 "COLUMN_DESCRIPTION": "A unique, human-readable string of the product's title. A handle can contain letters, hyphens, and numbers, but no spaces. The handle is used in the online store URL for the product.",
200 "IS_NULLABLE": False,
201 },
202 {
203 "TABLE_NAME": "products",
204 "COLUMN_NAME": "hasOnlyDefaultVariant",
205 "DATA_TYPE": "BOOLEAN",
206 "COLUMN_DESCRIPTION": "Whether the product has only a single variant with the default option and value.",
207 "IS_NULLABLE": False,
208 },
209 {
210 "TABLE_NAME": "products",
211 "COLUMN_NAME": "hasOutOfStockVariants",
212 "DATA_TYPE": "BOOLEAN",
213 "COLUMN_DESCRIPTION": "Whether the product has variants that are out of stock.",
214 "IS_NULLABLE": False,
215 },
216 {
217 "TABLE_NAME": "products",
218 "COLUMN_NAME": "hasVariantsThatRequiresComponents",
219 "DATA_TYPE": "BOOLEAN",
220 "COLUMN_DESCRIPTION": "Whether at least one of the product variants requires bundle components. Learn more about store eligibility for bundles.",
221 "IS_NULLABLE": False,
222 },
223 {
224 "TABLE_NAME": "products",
225 "COLUMN_NAME": "id",
226 "DATA_TYPE": "TEXT",
227 "COLUMN_DESCRIPTION": "A globally-unique ID.",
228 "IS_NULLABLE": False,
229 },
230 # {
231 # "TABLE_NAME": "products",
232 # "COLUMN_NAME": "inCollection",
233 # "DATA_TYPE": "BOOLEAN",
234 # "COLUMN_DESCRIPTION": "Whether the product is in a specified collection.",
235 # "IS_NULLABLE": False
236 # },
237 {
238 "TABLE_NAME": "products",
239 "COLUMN_NAME": "isGiftCard",
240 "DATA_TYPE": "BOOLEAN",
241 "COLUMN_DESCRIPTION": "Whether the product is a gift card.",
242 "IS_NULLABLE": False,
243 },
244 {
245 "TABLE_NAME": "products",
246 "COLUMN_NAME": "legacyResourceId",
247 "DATA_TYPE": "INT",
248 "COLUMN_DESCRIPTION": "The ID of the corresponding resource in the REST Admin API.",
249 "IS_NULLABLE": False,
250 },
251 # {
252 # "TABLE_NAME": "products",
253 # "COLUMN_NAME": "media",
254 # "DATA_TYPE": "JSON",
255 # "COLUMN_DESCRIPTION": "The media associated with the product. Valid media are images, 3D models, videos.",
256 # "IS_NULLABLE": False
257 # },
258 {
259 "TABLE_NAME": "products",
260 "COLUMN_NAME": "mediaCount",
261 "DATA_TYPE": "JSON",
262 "COLUMN_DESCRIPTION": "The total count of media that's associated with a product.",
263 "IS_NULLABLE": None,
264 },
265 # {
266 # "TABLE_NAME": "products",
267 # "COLUMN_NAME": "metafield",
268 # "DATA_TYPE": "JSON",
269 # "COLUMN_DESCRIPTION": "A custom field, including its namespace and key, that's associated with a Shopify resource for the purposes of adding and storing additional information.",
270 # "IS_NULLABLE": None
271 # },
272 # {
273 # "TABLE_NAME": "products",
274 # "COLUMN_NAME": "metafields",
275 # "DATA_TYPE": "JSON",
276 # "COLUMN_DESCRIPTION": "A list of custom fields that a merchant associates with a Shopify resource.",
277 # "IS_NULLABLE": False
278 # },
279 {
280 "TABLE_NAME": "products",
281 "COLUMN_NAME": "onlineStorePreviewUrl",
282 "DATA_TYPE": "TEXT",
283 "COLUMN_DESCRIPTION": "The preview URL for the online store.",
284 "IS_NULLABLE": None,
285 },
286 {
287 "TABLE_NAME": "products",
288 "COLUMN_NAME": "onlineStoreUrl",
289 "DATA_TYPE": "TEXT",
290 "COLUMN_DESCRIPTION": "The product's URL on the online store. If null, then the product isn't published to the online store sales channel.",
291 "IS_NULLABLE": None,
292 },
293 # {
294 # "TABLE_NAME": "products",
295 # "COLUMN_NAME": "options",
296 # "DATA_TYPE": "JSON",
297 # "COLUMN_DESCRIPTION": "A list of product options. The limit is defined by the shop's resource limits for product options.",
298 # "IS_NULLABLE": False
299 # },
300 {
301 "TABLE_NAME": "products",
302 "COLUMN_NAME": "priceRangeV2",
303 "DATA_TYPE": "JSON",
304 "COLUMN_DESCRIPTION": "The minimum and maximum prices of a product, expressed in decimal numbers. For example, if the product is priced between $10.00 and $50.00, then the price range is $10.00 - $50.00.",
305 "IS_NULLABLE": False,
306 },
307 # {
308 # "TABLE_NAME": "products",
309 # "COLUMN_NAME": "productComponents",
310 # "DATA_TYPE": "JSON",
311 # "COLUMN_DESCRIPTION": "A list of products that contain at least one variant associated with at least one of the current products' variants via group relationship.",
312 # "IS_NULLABLE": False
313 # },
314 {
315 "TABLE_NAME": "products",
316 "COLUMN_NAME": "productComponentsCount",
317 "DATA_TYPE": "JSON",
318 "COLUMN_DESCRIPTION": "A count of unique products that contain at least one variant associated with at least one of the current products' variants via group relationship.",
319 "IS_NULLABLE": None,
320 },
321 # {
322 # "TABLE_NAME": "products",
323 # "COLUMN_NAME": "productParents",
324 # "DATA_TYPE": "JSON",
325 # "COLUMN_DESCRIPTION": "A list of products that has a variant that contains any of this product's variants as a component.",
326 # "IS_NULLABLE": False
327 # },
328 {
329 "TABLE_NAME": "products",
330 "COLUMN_NAME": "productType",
331 "DATA_TYPE": "TEXT",
332 "COLUMN_DESCRIPTION": "The product type that merchants define.",
333 "IS_NULLABLE": False,
334 },
335 {
336 "TABLE_NAME": "products",
337 "COLUMN_NAME": "publishedAt",
338 "DATA_TYPE": "TEXT",
339 "COLUMN_DESCRIPTION": "The date and time when the product was published to the online store.",
340 "IS_NULLABLE": None,
341 },
342 # {
343 # "TABLE_NAME": "products",
344 # "COLUMN_NAME": "publishedInContext",
345 # "DATA_TYPE": "BOOLEAN",
346 # "COLUMN_DESCRIPTION": "Whether the product is published for a customer only in a specified context. For example, a product might be published for a customer only in a specific location.",
347 # "IS_NULLABLE": False
348 # },
349 # {
350 # "TABLE_NAME": "products",
351 # "COLUMN_NAME": "publishedOnCurrentPublication",
352 # "DATA_TYPE": "BOOLEAN",
353 # "COLUMN_DESCRIPTION": "Whether the resource is published to the app's publication. For example, the resource might be published to the app's online store channel.",
354 # "IS_NULLABLE": False
355 # },
356 # {
357 # "TABLE_NAME": "products",
358 # "COLUMN_NAME": "publishedOnPublication",
359 # "DATA_TYPE": "BOOLEAN",
360 # "COLUMN_DESCRIPTION": "Whether the resource is published to a specified publication.",
361 # "IS_NULLABLE": False
362 # },
363 {
364 "TABLE_NAME": "products",
365 "COLUMN_NAME": "requiresSellingPlan",
366 "DATA_TYPE": "BOOLEAN",
367 "COLUMN_DESCRIPTION": "Whether the product can only be purchased with a selling plan. Products that are sold on subscription can be updated only for online stores. If you update a product to be subscription-only, then the product is unpublished from all channels, except the online store.",
368 "IS_NULLABLE": False,
369 },
370 # {
371 # "TABLE_NAME": "products",
372 # "COLUMN_NAME": "resourcePublicationOnCurrentPublication",
373 # "DATA_TYPE": "JSON",
374 # "COLUMN_DESCRIPTION": "The resource that's either published or staged to be published to the publication.",
375 # "IS_NULLABLE": None
376 # },
377 # {
378 # "TABLE_NAME": "products",
379 # "COLUMN_NAME": "resourcePublications",
380 # "DATA_TYPE": "JSON",
381 # "COLUMN_DESCRIPTION": "The list of resources that are published to a publication.",
382 # "IS_NULLABLE": False
383 # },
384 {
385 "TABLE_NAME": "products",
386 "COLUMN_NAME": "resourcePublicationsCount",
387 "DATA_TYPE": "JSON",
388 "COLUMN_DESCRIPTION": "The number of publications that a resource is published to, without feedback errors.",
389 "IS_NULLABLE": None,
390 },
391 # {
392 # "TABLE_NAME": "products",
393 # "COLUMN_NAME": "resourcePublicationsV2",
394 # "DATA_TYPE": "JSON",
395 # "COLUMN_DESCRIPTION": "The list of resources that are either published or staged to be published to a publication.",
396 # "IS_NULLABLE": False
397 # },
398 # {
399 # "TABLE_NAME": "products",
400 # "COLUMN_NAME": "restrictedForResource",
401 # "DATA_TYPE": "JSON",
402 # "COLUMN_DESCRIPTION": "Whether the merchant can make changes to the product when they edit the order associated with the product. For example, a merchant might be restricted from changing product details when they edit an order.",
403 # "IS_NULLABLE": None
404 # },
405 # {
406 # "TABLE_NAME": "products",
407 # "COLUMN_NAME": "sellingPlanGroups",
408 # "DATA_TYPE": "JSON",
409 # "COLUMN_DESCRIPTION": "A list of all selling plan groups that are associated with the product either directly, or through the product's variants.",
410 # "IS_NULLABLE": False
411 # },
412 {
413 "TABLE_NAME": "products",
414 "COLUMN_NAME": "sellingPlanGroupsCount",
415 "DATA_TYPE": "JSON",
416 "COLUMN_DESCRIPTION": "A count of selling plan groups that are associated with the product.",
417 "IS_NULLABLE": None,
418 },
419 {
420 "TABLE_NAME": "products",
421 "COLUMN_NAME": "seo",
422 "DATA_TYPE": "JSON",
423 "COLUMN_DESCRIPTION": "The SEO title and description that are associated with a product.",
424 "IS_NULLABLE": False,
425 },
426 {
427 "TABLE_NAME": "products",
428 "COLUMN_NAME": "status",
429 "DATA_TYPE": "TEXT",
430 "COLUMN_DESCRIPTION": "The product status, which controls visibility across all sales channels.",
431 "IS_NULLABLE": False,
432 },
433 {
434 "TABLE_NAME": "products",
435 "COLUMN_NAME": "tags",
436 "DATA_TYPE": "JSON",
437 "COLUMN_DESCRIPTION": "A comma-separated list of searchable keywords that are associated with the product. For example, a merchant might apply the sports and summer tags to products that are associated with sportwear for summer. Updating tags overwrites any existing tags that were previously added to the product. To add new tags without overwriting existing tags, use the tagsAdd mutation.",
438 "IS_NULLABLE": False,
439 },
440 {
441 "TABLE_NAME": "products",
442 "COLUMN_NAME": "templateSuffix",
443 "DATA_TYPE": "TEXT",
444 "COLUMN_DESCRIPTION": "The theme template that's used when customers view the product in a store.",
445 "IS_NULLABLE": None,
446 },
447 {
448 "TABLE_NAME": "products",
449 "COLUMN_NAME": "title",
450 "DATA_TYPE": "TEXT",
451 "COLUMN_DESCRIPTION": "The name for the product that displays to customers. The title is used to construct the product's handle. For example, if a product is titled Black Sunglasses, then the handle is black-sunglasses.",
452 "IS_NULLABLE": False,
453 },
454 {
455 "TABLE_NAME": "products",
456 "COLUMN_NAME": "totalInventory",
457 "DATA_TYPE": "INT",
458 "COLUMN_DESCRIPTION": "The quantity of inventory that's in stock.",
459 "IS_NULLABLE": False,
460 },
461 {
462 "TABLE_NAME": "products",
463 "COLUMN_NAME": "tracksInventory",
464 "DATA_TYPE": "BOOLEAN",
465 "COLUMN_DESCRIPTION": "Whether inventory tracking has been enabled for the product.",
466 "IS_NULLABLE": False,
467 },
468 # {
469 # "TABLE_NAME": "products",
470 # "COLUMN_NAME": "translations",
471 # "DATA_TYPE": "JSON",
472 # "COLUMN_DESCRIPTION": "The published translations associated with the resource.",
473 # "IS_NULLABLE": False
474 # },
475 # {
476 # "TABLE_NAME": "products",
477 # "COLUMN_NAME": "unpublishedPublications",
478 # "DATA_TYPE": "JSON",
479 # "COLUMN_DESCRIPTION": "The list of publications that the resource isn't published to.",
480 # "IS_NULLABLE": False
481 # },
482 {
483 "TABLE_NAME": "products",
484 "COLUMN_NAME": "updatedAt",
485 "DATA_TYPE": "TEXT",
486 "COLUMN_DESCRIPTION": "The date and time when the product was last modified. A product's updatedAt value can change for different reasons. For example, if an order is placed for a product that has inventory tracking set up, then the inventory adjustment is counted as an update.",
487 "IS_NULLABLE": False,
488 },
489 # {
490 # "TABLE_NAME": "products",
491 # "COLUMN_NAME": "variants",
492 # "DATA_TYPE": "JSON",
493 # "COLUMN_DESCRIPTION": "A list of variants associated with the product. If querying a single product at the root, you can fetch up to 2048 variants.",
494 # "IS_NULLABLE": False
495 # },
496 {
497 "TABLE_NAME": "products",
498 "COLUMN_NAME": "variantsCount",
499 "DATA_TYPE": "JSON",
500 "COLUMN_DESCRIPTION": "The number of variants that are associated with the product.",
501 "IS_NULLABLE": None,
502 },
503 {
504 "TABLE_NAME": "products",
505 "COLUMN_NAME": "vendor",
506 "DATA_TYPE": "TEXT",
507 "COLUMN_DESCRIPTION": "The name of the product's vendor.",
508 "IS_NULLABLE": False,
509 },
510]