stack

Home > @infiniteobjects/shopify-data-manager > AdminTypes > Collection

AdminTypes.Collection interface

Represents a group of products that can be displayed in online stores and other sales channels in categories, which makes it easy for customers to find them. For example, an athletics store might create different collections for running attire, shoes, and accessories.

Collections can be defined by conditions, such as whether they match certain product tags. These are called smart or automated collections.

Collections can also be created for a custom group of products. These are called custom or manual collections.

Signature:

export interface Collection extends HasMetafieldDefinitions, HasMetafields, HasPublishedTranslations, Node, Publishable 

Extends: HasMetafieldDefinitions, HasMetafields, HasPublishedTranslations, Node, Publishable

Properties

Property Modifiers Type Description
availablePublicationCount   Scalars[‘Int’][‘output’] The number of publications a resource is published to without feedback errors.
description   Scalars[‘String’][‘output’] A single-line, text-only description of the collection, stripped of any HTML tags and formatting that were included in the description.
descriptionHtml   Scalars[‘HTML’][‘output’] The description of the collection, including any HTML tags and formatting. This content is typically displayed to customers, such as on an online store, depending on the theme.
feedback?   Maybe<ResourceFeedback> (Optional) Information about the collection that’s provided through resource feedback.
handle   Scalars[‘String’][‘output’] <p>A unique string that identifies the collection. If a handle isn’t specified when a collection is created, it’s automatically generated from the collection’s original title, and typically includes words from the title separated by hyphens. For example, a collection that was created with the title Summer Catalog 2022 might have the handle summer-catalog-2022.</p><p>If the title is changed, the handle doesn’t automatically change.</p><p>The handle can be used in themes by the Liquid templating language to refer to the collection, but using the ID is preferred because it never changes.</p>
hasProduct   Scalars[‘Boolean’][‘output’] Whether the collection includes the specified product.
id   Scalars[‘ID’][‘output’] A globally-unique ID.
image?   Maybe<Image> (Optional) The image associated with the collection.
legacyResourceId   Scalars[‘UnsignedInt64’][‘output’] The ID of the corresponding resource in the REST Admin API.
metafield?   Maybe<Metafield> (Optional) Returns a metafield by namespace and key that belongs to the resource.
metafieldDefinitions   MetafieldDefinitionConnection List of metafield definitions.
metafields   MetafieldConnection List of metafields that belong to the resource.
privateMetafield?   Maybe<PrivateMetafield> (Optional) Returns a private metafield by namespace and key that belongs to the resource.
privateMetafields   PrivateMetafieldConnection List of private metafields that belong to the resource.
products   ProductConnection The products that are included in the collection.
productsCount   Scalars[‘Int’][‘output’] The number of products in the collection.
publicationCount   Scalars[‘Int’][‘output’] The number of publications a resource is published on.
publications   CollectionPublicationConnection The channels where the collection is published.
publishedOnChannel   Scalars[‘Boolean’][‘output’] Check to see whether the resource is published to a given channel.
publishedOnCurrentChannel   Scalars[‘Boolean’][‘output’] Check to see whether the resource is published to the calling app’s channel.
publishedOnCurrentPublication   Scalars[‘Boolean’][‘output’] Check to see whether the resource is published to the calling app’s publication.
publishedOnPublication   Scalars[‘Boolean’][‘output’] Check to see whether the resource is published to a given publication.
resourcePublications   ResourcePublicationConnection The list of resources that are published to a publication.
resourcePublicationsV2   ResourcePublicationV2Connection The list of resources that are either published or staged to be published to a publication.
ruleSet?   Maybe<CollectionRuleSet> (Optional) For a smart (automated) collection, specifies the rules that determine whether a product is included.
seo   Seo If the default SEO fields for page title and description have been modified, contains the modified information.
sortOrder   CollectionSortOrder | `${CollectionSortOrder}` The order in which the products in the collection are displayed by default in the Shopify admin and in sales channels, such as an online store.
storefrontId   Scalars[‘StorefrontID’][‘output’] <p>The Storefront GraphQL API ID of the Collection.</p><p>As of the 2022-04 version release, the Storefront GraphQL API will no longer return Base64 encoded IDs to match the behavior of the Admin GraphQL API. Therefore, you can safely use the id field’s value instead.</p>
templateSuffix?   Maybe<Scalars[‘String’][‘output’]> (Optional) The suffix of the Liquid template being used to show the collection in an online store. For example, if the value is custom, then the collection is using the collection.custom.liquid template. If the value is null, then the collection is using the default collection.liquid template.
title   Scalars[‘String’][‘output’] The name of the collection. It’s displayed in the Shopify admin and is typically displayed in sales channels, such as an online store.
translations   Array<Translation> The translations associated with the resource.
unpublishedChannels   ChannelConnection The list of channels that the resource is not published to.
unpublishedPublications   PublicationConnection The list of publications that the resource is not published to.
updatedAt   Scalars[‘DateTime’][‘output’] The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) when the collection was last modified.