# Internal Structure

## Class `CheckoutQuery`

```javascript
import {CheckoutQuery} from '@scandipwa/shopify-checkout/src/api/Checkout.query.js'
```

**Description:** Checkout 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**: `ShopifyCheckout/Api/Checkout/Query/CheckoutQuery`

### Method `_getCheckoutFields`

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

### Method `getCheckoutField`

**Description:** Checkout by ID fields getter \[returns node]

### Method `getCreateCheckoutField`

**Description:** Create checkout fields getter \[returns node]

## Function `processCheckout`

```javascript
import {processCheckout} from '@scandipwa/shopify-checkout/src/api/Checkout.processor.js'
```

**Description:** Checkout processor. Returns void, instead it modifies the passed argument.

**Namespace**: `ShopifyCheckout/Api/Checkout/Processor/processCheckout`

## Variable `CREATE_CHECKOUT`

```javascript
import {CREATE_CHECKOUT} from '@scandipwa/shopify-checkout/src/api/Checkout.query.js'
```

**Description:** A type of `CheckoutQuery` associated with `getCreateCheckoutField` function.

**Usage examples:**

```javascript
// Returns getter of create checkout mutation
import getCheckoutQueryByType, { CREATE_CHECKOUT } from '@scandipwa/shopify-checkout/src/api/Checkout.query.js';
const queryGetter = getCheckoutQueryByType(CREATE_CHECKOUT);
```

## Variable `FETCH_CHECKOUT`

```javascript
import {FETCH_CHECKOUT} from '@scandipwa/shopify-checkout/src/api/Checkout.query.js'
```

**Description:** A type of `CheckoutQuery` associated with `getCheckoutField` function.

**Usage examples:**

```javascript
// Returns getter of checkout query
import getCheckoutQueryByType, { FETCH_CHECKOUT } from '@scandipwa/shopify-checkout/src/api/Checkout.query.js';
const queryGetter = getCheckoutQueryByType(FETCH_CHECKOUT);
```

## Function `CartFallbackPage`

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

**Description:** The component to be used as fallback while the cart page is loading

**Namespace**: `ShopifyCheckout/Component/CartFallbackPage/Index/CartFallbackPage`

## Class `CartPageComponent`

```javascript
import {CartPageComponent} from '@scandipwa/shopify-checkout/src/component/CartPage/CartPage.component.js'
```

**Description:** Cart page component

**Namespace**: `ShopifyCheckout/Component/CartPage/Component/CartPageComponent`

### Member `sortedRenderMap`

**Description:** The list of sections to be displayed on the cart page. Read more: [SortedRenderMap](https://scandipwa.gitbook.io/shopify/solutions/sortedmap-and-sortedrendermap)

## Class `CheckoutProvider`

```javascript
import {CheckoutProvider} from '@scandipwa/shopify-checkout/src/context/Checkout.provider.js'
```

**Description:** Provider class for Checkout Context. Used to make checkout data available to every component in the app

**Namespace**: `ShopifyCheckout/Context/Checkout/Provider/CheckoutProvider`

### Method `getContextValue`

**Description:** A function which returns an object that will be visible in the Checkout Context

**🔮 Common extension point:** Add more fields to Checkout Context outside of Shopify API

```javascript
{
    'ShopifyCheckout/Context/Checkout/Provider/CheckoutProvider': {
        'member-function': {
            'getContextValue': (args, callback) => ({
                     ...args,
                     isEligibleForCheckout: isUserLoggedIn
                })
        }
    }
}
```

{% 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 %}
