# Internal Structure

## Class `CollectionsQuery`

```javascript
import {CollectionsQuery} from '@scandipwa/shopify-collections/src/api/Collections.query.js'
```

**Description:** A general collection and collection-list query declaration. Read more: [Query controller](https://app.gitbook.com/@scandipwa/s/shopify/solutions/query-controller), [TypedQuery](https://app.gitbook.com/@scandipwa/s/shopify/solutions/query-controller#typedquery)

**Namespace**: `ShopifyCollections/Api/Collections/Query/CollectionsQuery`

### Method `_getCollectionFields`

**Description:** A function which returns an array of collection fields. Read more: [Extending Query controllers](https://app.gitbook.com/@scandipwa/s/shopify/solutions/query-controller#extension)

### Method `getCollectionByHandleField`

**Description:** General collection field getter (by handle) \[returns node]

### Method `getCollectionsField`

**Description:** General collection list field getter \[returns edges]

## Function `collectionsResponseProcessor`

```javascript
import {collectionsResponseProcessor} from '@scandipwa/shopify-collections/src/api/Collections.processor.js'
```

**Description:** The collection-list query response processor (from edges and nodes creates an array of collections)

**Namespace**: `ShopifyCollections/Api/Collections/Processor/collectionsResponseProcessor`

## Function `processCollection`

```javascript
import {processCollection} from '@scandipwa/shopify-collections/src/api/Collections.processor.js'
```

**Description:** The single product processor. Returns void, instead it modifies the passed argument.

**Namespace**: `ShopifyCollections/Api/Collections/Processor/processCollection`

**🔮 Common extension point:** Great place to add some "calculated" field into collection

```javascript
{
    'ShopifyCollections/Api/Collections/Processor/processCollection': {
        'function': ([collection], callback) => {
                callback(collection);
                collection.myField = collection.id + collection.handle;
            }
    }
}
```

## Function `processCollectionByHandleResponse`

```javascript
import {processCollectionByHandleResponse} from '@scandipwa/shopify-collections/src/api/Collections.processor.js'
```

**Description:** The single collection query response processor

**Namespace**: `ShopifyCollections/Api/Collections/Processor/processCollectionByHandleResponse`

## Variable `PAGINATED_COLLECTIONS`

```javascript
import {PAGINATED_COLLECTIONS} from '@scandipwa/shopify-collections/src/api/Collections.query.js'
```

**Description:** A type of `CollectionsQuery` associated with `getCollectionsField` function.

**Usage examples:**

```javascript
// Returns getter of paginated collections query
import getCollectionQueryByType, { PAGINATED_COLLECTIONS } from '@scandipwa/shopify-collections/src/api/Collections.query.js';
const queryGetter = getCollectionQueryByType(PAGINATED_COLLECTIONS);
```

## Variable `SINGLE_COLLECTION`

```javascript
import {SINGLE_COLLECTION} from '@scandipwa/shopify-collections/src/api/Collections.query.js'
```

**Description:** A type of `CollectionsQuery` associated with `getCollectionByHandleField` function.

**Usage examples:**

```javascript
// Returns getter of single collection query
import getCollectionQueryByType, { SINGLE_COLLECTION } from '@scandipwa/shopify-collections/src/api/Collections.query.js';
const queryGetter = getCollectionQueryByType(SINGLE_COLLECTION);
```

## Class `CollectionCardComponent`

```javascript
import {CollectionCardComponent} from '@scandipwa/shopify-collections/src/component/CollectionCard/CollectionCard.component.js'
```

**Description:** The collection card (preview) component

**Namespace**: `ShopifyCollections/Component/CollectionCard/Component/CollectionCardComponent`

### Member `sortedRenderMap`

**Description:** A list of render methods used by collection card. Read more: [SortedRenderMap](/shopify/solutions/sortedmap-and-sortedrendermap.md)

## Function `CollectionFallbackPage`

```javascript
import {CollectionFallbackPage} from '@scandipwa/shopify-collections/src/component/CollectionFallbackPage/index.js'
```

**Description:** A component used as fallback while the collection page is loading

**Namespace**: `ShopifyCollections/Component/CollectionFallbackPage/Index/CollectionFallbackPage`

## Class `CollectionPageComponent`

```javascript
import {CollectionPageComponent} from '@scandipwa/shopify-collections/src/component/CollectionPage/CollectionPage.component.js'
```

**Description:** Collection page component

**Namespace**: `ShopifyCollections/Component/CollectionPage/Component/CollectionPageComponent`

### Member `sortedRenderMap`

**Description:** A list of render methods used by collection page. Read more: [SortedRenderMap](/shopify/solutions/sortedmap-and-sortedrendermap.md)

## Function `CollectionsFallbackPage`

```javascript
import {CollectionsFallbackPage} from '@scandipwa/shopify-collections/src/component/CollectionsFallbackPage/index.js'
```

**Description:** A component used as fallback while the collections page is loading

**Namespace**: `ShopifyCollections/Component/CollectionsFallbackPage/Index/CollectionsFallbackPage`

## Class `CollectionsPageComponent`

```javascript
import {CollectionsPageComponent} from '@scandipwa/shopify-collections/src/component/CollectionsPage/CollectionsPage.component.js'
```

**Description:** Product listing page component

**Namespace**: `ShopifyCollections/Component/CollectionsPage/Component/CollectionsPageComponent`

{% hint style="danger" %}

### **This page is automatically generated**

All modification will be erased during the next deployment. If you intend to modify the contents, please refer to the source-code.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://scandipwa.gitbook.io/shopify/packages/shopify-collections/structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
