shopify-data-faker
Version:
A Shopify development tool for generating dummy store data.
1,268 lines (1,173 loc) • 870 kB
text/typescript
import { GraphQLClient } from 'graphql-request';
import * as Dom from 'graphql-request/dist/types.dom';
import gql from 'graphql-tag';
export type Maybe<T> = T | null;
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
ID: string;
String: string;
Boolean: boolean;
Int: number;
Float: number;
/** Amazon Web Services ARN. */
ARN: any;
/** An [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) encoded UTC date string. Example value: `"2019-07-16"`. */
Date: any;
/** An ISO-8601 encoded UTC date time string. Example value: `"2019-07-03T20:47:55Z"`. */
DateTime: any;
/** A signed decimal number, which supports arbitrary precision and is serialized as a string. Example value: `"29.99"`. */
Decimal: any;
/**
* A string containing a strict subset of HTML code. Non-allowed tags will be stripped out.
* Allowed tags:
* * `a` (allowed attributes: `href`)
* * `b`
* * `br`
* * `em`
* * `i`
* * `strong`
* * `u`
*
* Example value: `"Your current domain is <strong>johns-apparel.myshopify.com</strong>."`
*/
FormattedString: any;
/** A string containing HTML code. Example value: `"<p>Grey cotton knit sweater.</p>"`. */
HTML: any;
/** A JSON Object. Example value: `{ "key1": "Value 1", "key2": "Value 2", "key3": 3 }` */
JSON: any;
/** A monetary value string. Example value: `"100.57"`. */
Money: any;
/**
* Represents a unique identifier in the Storefront API. A `StorefrontID` value can be used wherever an ID is expected in the Storefront API.
*
* Example value: `"Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzEwMDc5Nzg1MTAw"`.
*/
StorefrontID: any;
/**
* An RFC 3986 and RFC 3987 compliant URI string.
*
* Example value: `"https://johns-apparel.myshopify.com"`.
*/
URL: any;
/**
* An unsigned 64-bit integer. Represents whole numeric values between 0 and 2^64 - 1 encoded as a string of base-10 digits.
*
* Example value: `"50"`.
*/
UnsignedInt64: any;
/**
* Time between UTC time and a location's observed time, in the format `"+HH:MM"` or `"-HH:MM"`.
*
* Example value: `"-07:00"`.
*/
UtcOffset: any;
};
/** Represents the access scope permission that is applicable to a merchant's shop, such as `read_orders`. */
export type AccessScope = {
__typename?: 'AccessScope';
/** Description of the access scopes enabled on an api permission. */
description: Scalars['String'];
/** A human-friendly string for an access scope. */
handle: Scalars['String'];
};
/** Whether all items in the cart are entitled to the discount. */
export type AllDiscountItems = {
__typename?: 'AllDiscountItems';
/** Whether all items are selected. The value is hardcoded to `true`. */
allItems: Scalars['Boolean'];
};
/** A version of the API. */
export type ApiVersion = {
__typename?: 'ApiVersion';
/** The human-readable name of the version. */
displayName: Scalars['String'];
/** The unique identifier of an ApiVersion. All supported API versions have a date-based (YYYY-MM) or `unstable` handle. */
handle: Scalars['String'];
/** Whether the version is actively supported by Shopify. Supported API versions are guaranteed to be stable. Unsupported API versions include unstable, release candidate, and end-of-life versions that are marked as unsupported. For more information, refer to [Versioning](https://shopify.dev/concepts/about-apis/versioning). */
supported: Scalars['Boolean'];
};
/** A Shopify application. */
export type App = Node & {
__typename?: 'App';
/** A unique application API identifier. */
apiKey: Scalars['String'];
/** App store page URL of the app. */
appStoreAppUrl?: Maybe<Scalars['URL']>;
/** App store page URL of the developer who created the app. */
appStoreDeveloperUrl?: Maybe<Scalars['URL']>;
/** Banner image for the app. */
banner: Image;
/** Description of the app. */
description?: Maybe<Scalars['String']>;
/** App's developer name. */
developerName?: Maybe<Scalars['String']>;
/**
* Website of the developer who created the app.
* @deprecated Use `appStoreDeveloperUrl` instead
*/
developerUrl: Scalars['URL'];
/** Whether the app uses the Embedded App SDK. */
embedded: Scalars['Boolean'];
/** Requirements that must be met before the app can be installed. */
failedRequirements: Array<FailedRequirement>;
/** List of app features. */
features: Array<Scalars['String']>;
/** Feedback from this app about the store. */
feedback?: Maybe<AppFeedback>;
/** Handle of the app. */
handle?: Maybe<Scalars['String']>;
/** Icon that represents the app. */
icon: Image;
/** Globally unique identifier. */
id: Scalars['ID'];
/** Webpage where you can install the app. */
installUrl?: Maybe<Scalars['URL']>;
/**
* Corresponding AppInstallation for this shop and App.
* Returns null if the App is not installed.
*/
installation?: Maybe<AppInstallation>;
/**
* Webpage that the app starts in.
* @deprecated Use AppInstallation.launchUrl instead
*/
launchUrl: Scalars['URL'];
/**
* Menu items for the app, which also appear as submenu items in left navigation sidebar in the Shopify admin.
* @deprecated Use AppInstallation.navigationItems instead
*/
navigationItems: Array<NavigationItem>;
/** Detailed information about the app pricing. */
pricingDetails?: Maybe<Scalars['String']>;
/** Summary of the app pricing details. */
pricingDetailsSummary: Scalars['String'];
/** Link to app privacy policy. */
privacyPolicyUrl?: Maybe<Scalars['URL']>;
/** Whether the app is published. */
published: Scalars['Boolean'];
/** Screenshots of the app. */
screenshots: Array<Image>;
/** Whether the app was developed by Shopify. */
shopifyDeveloped: Scalars['Boolean'];
/** Name of the app. */
title: Scalars['String'];
/**
* Message that appears when the app is uninstalled. For example:
* By removing this app, you will no longer be able to publish products to MySocialSite or view this app in your Shopify admin. You can re-enable this channel at any time.
*/
uninstallMessage: Scalars['String'];
/**
* Webpage where you can uninstall the app.
* @deprecated Use AppInstallation.uninstallUrl instead
*/
uninstallUrl?: Maybe<Scalars['URL']>;
};
/** An auto-generated type for paginating through multiple Apps. */
export type AppConnection = {
__typename?: 'AppConnection';
/** A list of edges. */
edges: Array<AppEdge>;
/** Information to aid in pagination. */
pageInfo: PageInfo;
};
/** App credits can be applied by the merchant towards future app purchases, subscriptions, or usage records in Shopify. */
export type AppCredit = Node & {
__typename?: 'AppCredit';
/** The amount that can be used towards future app purchases in Shopify. */
amount: MoneyV2;
/** The date and time when the app credit was created. */
createdAt: Scalars['DateTime'];
/** The description of the app credit. */
description: Scalars['String'];
/** Globally unique identifier. */
id: Scalars['ID'];
/** Whether the app credit is a test transaction. */
test: Scalars['Boolean'];
};
/** An auto-generated type for paginating through multiple AppCredits. */
export type AppCreditConnection = {
__typename?: 'AppCreditConnection';
/** A list of edges. */
edges: Array<AppCreditEdge>;
/** Information to aid in pagination. */
pageInfo: PageInfo;
};
/** Return type for `appCreditCreate` mutation. */
export type AppCreditCreatePayload = {
__typename?: 'AppCreditCreatePayload';
/** The newly created app credit. */
appCredit?: Maybe<AppCredit>;
/** List of errors that occurred executing the mutation. */
userErrors: Array<UserError>;
};
/** An auto-generated type which holds one AppCredit and a cursor during pagination. */
export type AppCreditEdge = {
__typename?: 'AppCreditEdge';
/** A cursor for use in pagination. */
cursor: Scalars['String'];
/** The item at the end of AppCreditEdge. */
node: AppCredit;
};
/** An auto-generated type which holds one App and a cursor during pagination. */
export type AppEdge = {
__typename?: 'AppEdge';
/** A cursor for use in pagination. */
cursor: Scalars['String'];
/** The item at the end of AppEdge. */
node: App;
};
/**
* Reports the status of shops and their resources and displays this information
* within Shopify admin. AppFeedback is used to notify merchants about steps they need to take
* to set up an app on their store.
*/
export type AppFeedback = {
__typename?: 'AppFeedback';
/** The application associated to the feedback. */
app: App;
/** A link to where merchants can resolve errors. */
link?: Maybe<Link>;
/** The feedback message presented to the merchant. */
messages: Array<UserError>;
};
/** Represents an installed application on a shop. */
export type AppInstallation = Node & {
__typename?: 'AppInstallation';
/** Access scopes granted to an app by a merchant during installation. */
accessScopes: Array<AccessScope>;
/** Active subscriptions charged to a shop on a recurring basis. */
activeSubscriptions: Array<AppSubscription>;
/** All subscriptions created for a shop. */
allSubscriptions: AppSubscriptionConnection;
/** Application which is installed. */
app: App;
/**
* Channel associated with the installed application.
* @deprecated Use `publication` instead
*/
channel?: Maybe<Channel>;
/** Credits that can be used towards future app purchases. */
credits: AppCreditConnection;
/** Globally unique identifier. */
id: Scalars['ID'];
/** Url used to launch the app. */
launchUrl: Scalars['URL'];
/** One-time purchases to a shop. */
oneTimePurchases: AppPurchaseOneTimeConnection;
/** Publication associated with the installed application. */
publication?: Maybe<Publication>;
/** The records that track the externally-captured revenue for the app. The records are used for revenue attribution purposes. */
revenueAttributionRecords: AppRevenueAttributionRecordConnection;
/**
* Subscriptions charge to a shop on a recurring basis.
* @deprecated Use `activeSubscriptions` instead
*/
subscriptions: Array<AppSubscription>;
/** Webpage where you can uninstall the app. */
uninstallUrl?: Maybe<Scalars['URL']>;
};
/** Represents an installed application on a shop. */
export type AppInstallationAllSubscriptionsArgs = {
first?: Maybe<Scalars['Int']>;
after?: Maybe<Scalars['String']>;
last?: Maybe<Scalars['Int']>;
before?: Maybe<Scalars['String']>;
reverse?: Maybe<Scalars['Boolean']>;
sortKey?: Maybe<AppSubscriptionSortKeys>;
};
/** Represents an installed application on a shop. */
export type AppInstallationCreditsArgs = {
first?: Maybe<Scalars['Int']>;
after?: Maybe<Scalars['String']>;
last?: Maybe<Scalars['Int']>;
before?: Maybe<Scalars['String']>;
reverse?: Maybe<Scalars['Boolean']>;
sortKey?: Maybe<AppTransactionSortKeys>;
};
/** Represents an installed application on a shop. */
export type AppInstallationOneTimePurchasesArgs = {
first?: Maybe<Scalars['Int']>;
after?: Maybe<Scalars['String']>;
last?: Maybe<Scalars['Int']>;
before?: Maybe<Scalars['String']>;
reverse?: Maybe<Scalars['Boolean']>;
sortKey?: Maybe<AppTransactionSortKeys>;
};
/** Represents an installed application on a shop. */
export type AppInstallationRevenueAttributionRecordsArgs = {
first?: Maybe<Scalars['Int']>;
after?: Maybe<Scalars['String']>;
last?: Maybe<Scalars['Int']>;
before?: Maybe<Scalars['String']>;
reverse?: Maybe<Scalars['Boolean']>;
sortKey?: Maybe<AppRevenueAttributionRecordSortKeys>;
};
/** Possible categories of an app installation. */
export enum AppInstallationCategory {
/** Sales channel apps. */
Channel = 'CHANNEL',
/** Apps that can be used in the POS mobile client. */
PosEmbedded = 'POS_EMBEDDED'
}
/** An auto-generated type for paginating through multiple AppInstallations. */
export type AppInstallationConnection = {
__typename?: 'AppInstallationConnection';
/** A list of edges. */
edges: Array<AppInstallationEdge>;
/** Information to aid in pagination. */
pageInfo: PageInfo;
};
/** An auto-generated type which holds one AppInstallation and a cursor during pagination. */
export type AppInstallationEdge = {
__typename?: 'AppInstallationEdge';
/** A cursor for use in pagination. */
cursor: Scalars['String'];
/** The item at the end of AppInstallationEdge. */
node: AppInstallation;
};
/** Possible privacy types of an app installation. */
export enum AppInstallationPrivacy {
Public = 'PUBLIC',
Private = 'PRIVATE'
}
/** The set of valid sort keys for the AppInstallation query. */
export enum AppInstallationSortKeys {
/** Sort by the `installed_at` value. */
InstalledAt = 'INSTALLED_AT',
/** Sort by the `app_title` value. */
AppTitle = 'APP_TITLE',
/** Sort by the `id` value. */
Id = 'ID',
/**
* During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the
* results by relevance to the search term(s). When no search query is specified, this sort key is not
* deterministic and should not be used.
*/
Relevance = 'RELEVANCE'
}
/** Defines the pricing model for the app subscription. */
export type AppPlanInput = {
/** Usage based billing pricing details. */
appUsagePricingDetails?: Maybe<AppUsagePricingInput>;
/** Recurring based billing pricing details. */
appRecurringPricingDetails?: Maybe<AppRecurringPricingInput>;
};
/** Defines the app plan the merchant is subscribed to. */
export type AppPlanV2 = {
__typename?: 'AppPlanV2';
/** Defines the pricing model for the app subscription. */
pricingDetails: AppPricingDetails;
};
/** Information about the price charged to a shop every plan period. */
export type AppPricingDetails = AppRecurringPricing | AppUsagePricing;
/** The billing frequency for the app. */
export enum AppPricingInterval {
/** The merchant is billed for this app annually. */
Annual = 'ANNUAL',
/** The merchant is billed for this app every 30 days. */
Every_30Days = 'EVERY_30_DAYS'
}
/** Services and features purchased once by the store. */
export type AppPurchase = {
/** The date and time when the app purchase was created. */
createdAt: Scalars['DateTime'];
/** The name of the app purchase. */
name: Scalars['String'];
/** The amount to be charged to the store for the app purchase. */
price: MoneyV2;
/** The status of the app purchase. Possible values include pending, active, declined and cancelled. */
status: AppPurchaseStatus;
/** Whether the app purchase is a test transaction. */
test: Scalars['Boolean'];
};
/** Services and features purchased once by a store. */
export type AppPurchaseOneTime = AppPurchase & Node & {
__typename?: 'AppPurchaseOneTime';
/** The date and time when the app purchase was created. */
createdAt: Scalars['DateTime'];
/** Globally unique identifier. */
id: Scalars['ID'];
/** The name of the app purchase. */
name: Scalars['String'];
/** The amount to be charged to the store for the app purchase. */
price: MoneyV2;
/** The status of the app purchase. Possible values include pending, active, declined and cancelled. */
status: AppPurchaseStatus;
/** Whether the app purchase is a test transaction. */
test: Scalars['Boolean'];
};
/** An auto-generated type for paginating through multiple AppPurchaseOneTimes. */
export type AppPurchaseOneTimeConnection = {
__typename?: 'AppPurchaseOneTimeConnection';
/** A list of edges. */
edges: Array<AppPurchaseOneTimeEdge>;
/** Information to aid in pagination. */
pageInfo: PageInfo;
};
/** Return type for `appPurchaseOneTimeCreate` mutation. */
export type AppPurchaseOneTimeCreatePayload = {
__typename?: 'AppPurchaseOneTimeCreatePayload';
/** The newly created app one-time purchase. */
appPurchaseOneTime?: Maybe<AppPurchaseOneTime>;
/** The URL where the merchant can approve or decline the app one-time purchase. */
confirmationUrl?: Maybe<Scalars['URL']>;
/** List of errors that occurred executing the mutation. */
userErrors: Array<UserError>;
};
/** An auto-generated type which holds one AppPurchaseOneTime and a cursor during pagination. */
export type AppPurchaseOneTimeEdge = {
__typename?: 'AppPurchaseOneTimeEdge';
/** A cursor for use in pagination. */
cursor: Scalars['String'];
/** The item at the end of AppPurchaseOneTimeEdge. */
node: AppPurchaseOneTime;
};
/** The status of the purchase. */
export enum AppPurchaseStatus {
/** The app purchase has been approved by the merchant and is ready to be activated by the app. App purchases created through the GraphQL Admin API are activated upon approval. */
Accepted = 'ACCEPTED',
/** The app purchase has been activated by the app. Active app purchases are charged to the store and partners receive payouts for active app purchase. */
Active = 'ACTIVE',
/** The app purchase was declined by the merchant. */
Declined = 'DECLINED',
/** The app purchase was not accepted within 2 days of being created. */
Expired = 'EXPIRED',
/** The app purchase is pending approval by the merchant. */
Pending = 'PENDING'
}
/** Price charged every interval. */
export type AppRecurringPricing = {
__typename?: 'AppRecurringPricing';
/** Specifies the number of days in a billing cycle of the app subscription. */
interval: AppPricingInterval;
/** The amount to be charged to the store every billing interval. */
price: MoneyV2;
};
/** Allows an app to charge per billing interval. */
export type AppRecurringPricingInput = {
/** Specifies the billing frequency of the app subscription. */
interval?: Maybe<AppPricingInterval>;
/** The amount to be charged to the store every billing interval. The only permitted currency code is USD. */
price: MoneyInput;
};
/** Represents app revenue that was captured externally by the partner. */
export type AppRevenueAttributionRecord = Node & {
__typename?: 'AppRevenueAttributionRecord';
/** The financial amount captured in this attribution. */
amount: MoneyV2;
/** The timestamp when the financial amount was captured. */
capturedAt: Scalars['DateTime'];
/** The timestamp at which this revenue attribution was issued. */
createdAt: Scalars['DateTime'];
/** Globally unique identifier. */
id: Scalars['ID'];
/**
* The unique value submitted during the creation of the app revenue attribution record.
* For more information, refer to
* [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests).
*/
idempotencyKey: Scalars['String'];
/** Indicates whether this is a test submission. */
test: Scalars['Boolean'];
/** The type of revenue attribution. */
type: AppRevenueAttributionType;
};
/** An auto-generated type for paginating through multiple AppRevenueAttributionRecords. */
export type AppRevenueAttributionRecordConnection = {
__typename?: 'AppRevenueAttributionRecordConnection';
/** A list of edges. */
edges: Array<AppRevenueAttributionRecordEdge>;
/** Information to aid in pagination. */
pageInfo: PageInfo;
};
/** Return type for `appRevenueAttributionRecordCreate` mutation. */
export type AppRevenueAttributionRecordCreatePayload = {
__typename?: 'AppRevenueAttributionRecordCreatePayload';
/** The created app revenue attribution record. */
appRevenueAttributionRecord?: Maybe<AppRevenueAttributionRecord>;
/** List of errors that occurred executing the mutation. */
userErrors: Array<AppRevenueAttributionRecordCreateUserError>;
};
/** An error that occurs during the execution of AppRevenueAttributionRecordCreate. */
export type AppRevenueAttributionRecordCreateUserError = DisplayableError & {
__typename?: 'AppRevenueAttributionRecordCreateUserError';
/** Error code to uniquely identify the error. */
code?: Maybe<AppRevenueAttributionRecordCreateUserErrorCode>;
/** Path to the input field which caused the error. */
field?: Maybe<Array<Scalars['String']>>;
/** The error message. */
message: Scalars['String'];
};
/** Possible error codes that could be returned by AppRevenueAttributionRecordCreateUserError. */
export enum AppRevenueAttributionRecordCreateUserErrorCode {
/** Input value is invalid. */
Invalid = 'INVALID',
/** Input value is already taken. */
Taken = 'TAKEN'
}
/** Return type for `appRevenueAttributionRecordDelete` mutation. */
export type AppRevenueAttributionRecordDeletePayload = {
__typename?: 'AppRevenueAttributionRecordDeletePayload';
/** The revenue attribution that was deleted, if one was. */
deletedId?: Maybe<Scalars['ID']>;
/** List of errors that occurred executing the mutation. */
userErrors: Array<AppRevenueAttributionRecordDeleteUserError>;
};
/** An error that occurs during the execution of AppRevenueAttributionRecordDelete. */
export type AppRevenueAttributionRecordDeleteUserError = DisplayableError & {
__typename?: 'AppRevenueAttributionRecordDeleteUserError';
/** Error code to uniquely identify the error. */
code?: Maybe<AppRevenueAttributionRecordDeleteUserErrorCode>;
/** Path to the input field which caused the error. */
field?: Maybe<Array<Scalars['String']>>;
/** The error message. */
message: Scalars['String'];
};
/** Possible error codes that could be returned by AppRevenueAttributionRecordDeleteUserError. */
export enum AppRevenueAttributionRecordDeleteUserErrorCode {
/** Input value is invalid. */
Invalid = 'INVALID'
}
/** An auto-generated type which holds one AppRevenueAttributionRecord and a cursor during pagination. */
export type AppRevenueAttributionRecordEdge = {
__typename?: 'AppRevenueAttributionRecordEdge';
/** A cursor for use in pagination. */
cursor: Scalars['String'];
/** The item at the end of AppRevenueAttributionRecordEdge. */
node: AppRevenueAttributionRecord;
};
/** Allows to supply an app revenue attribution record. */
export type AppRevenueAttributionRecordInput = {
/**
* The unique value submitted during creation.
* For more information, refer to
* [Idempotent requests](https://shopify.dev/concepts/about-apis/idempotent-requests).
*/
idempotencyKey: Scalars['String'];
/** The timestamp when the financial amount was captured. */
capturedAt: Scalars['DateTime'];
/** The financial amount captured in this attribution. */
amount: MoneyInput;
/** The type of revenue attribution. */
type: AppRevenueAttributionType;
/** Indicates whether this is a test submission. */
test: Scalars['Boolean'];
};
/** The set of valid sort keys for the AppRevenueAttributionRecord query. */
export enum AppRevenueAttributionRecordSortKeys {
/** Sort by the `created_at` value. */
CreatedAt = 'CREATED_AT',
/** Sort by the `id` value. */
Id = 'ID',
/**
* During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the
* results by relevance to the search term(s). When no search query is specified, this sort key is not
* deterministic and should not be used.
*/
Relevance = 'RELEVANCE'
}
/** Represents the billing types of revenue attribution. */
export enum AppRevenueAttributionType {
/** App purchase related revenue collection. */
ApplicationPurchase = 'APPLICATION_PURCHASE',
/** App subscription revenue collection. */
ApplicationSubscription = 'APPLICATION_SUBSCRIPTION',
/** App usage-based revenue collection. */
ApplicationUsage = 'APPLICATION_USAGE',
/** Other app revenue collection type. */
Other = 'OTHER'
}
/** Provides users access to services and/or features for a duration of time. */
export type AppSubscription = Node & {
__typename?: 'AppSubscription';
/** The date and time when the app subscription was created. */
createdAt: Scalars['DateTime'];
/** The date and time when the current app subscription period ends. */
currentPeriodEnd?: Maybe<Scalars['DateTime']>;
/** Globally unique identifier. */
id: Scalars['ID'];
/** Attaches a plan to an app subscription. */
lineItems: Array<AppSubscriptionLineItem>;
/** The name of the app subscription. */
name: Scalars['String'];
/** The URL where the merchant is redirected after approving the app subscription. */
returnUrl: Scalars['URL'];
/**
* The status of the app subscription. Possible values include pending, active, declined,
* expired, frozen, and cancelled.
*/
status: AppSubscriptionStatus;
/** Specifies whether the app subscription is a test transaction. */
test: Scalars['Boolean'];
/** The number of days of the free trial. */
trialDays: Scalars['Int'];
};
/** Return type for `appSubscriptionCancel` mutation. */
export type AppSubscriptionCancelPayload = {
__typename?: 'AppSubscriptionCancelPayload';
/** The cancelled app subscription. */
appSubscription?: Maybe<AppSubscription>;
/** List of errors that occurred executing the mutation. */
userErrors: Array<UserError>;
};
/** An auto-generated type for paginating through multiple AppSubscriptions. */
export type AppSubscriptionConnection = {
__typename?: 'AppSubscriptionConnection';
/** A list of edges. */
edges: Array<AppSubscriptionEdge>;
/** Information to aid in pagination. */
pageInfo: PageInfo;
};
/** Return type for `appSubscriptionCreate` mutation. */
export type AppSubscriptionCreatePayload = {
__typename?: 'AppSubscriptionCreatePayload';
/** The newly created app subscription. */
appSubscription?: Maybe<AppSubscription>;
/** The URL where the merchant approves or declines an app subscription. */
confirmationUrl?: Maybe<Scalars['URL']>;
/** List of errors that occurred executing the mutation. */
userErrors: Array<UserError>;
};
/** An auto-generated type which holds one AppSubscription and a cursor during pagination. */
export type AppSubscriptionEdge = {
__typename?: 'AppSubscriptionEdge';
/** A cursor for use in pagination. */
cursor: Scalars['String'];
/** The item at the end of AppSubscriptionEdge. */
node: AppSubscription;
};
/** Attaches a plan to an app subscription. */
export type AppSubscriptionLineItem = {
__typename?: 'AppSubscriptionLineItem';
/** Globally unique identifier. */
id: Scalars['ID'];
/** Defines the pricing model for the app subscription. */
plan: AppPlanV2;
/** Lists the store's usage for a usage pricing plan. */
usageRecords: AppUsageRecordConnection;
};
/** Attaches a plan to an app subscription. */
export type AppSubscriptionLineItemUsageRecordsArgs = {
first?: Maybe<Scalars['Int']>;
after?: Maybe<Scalars['String']>;
last?: Maybe<Scalars['Int']>;
before?: Maybe<Scalars['String']>;
reverse?: Maybe<Scalars['Boolean']>;
sortKey?: Maybe<AppUsageRecordSortKeys>;
};
/** Allows an app to add more than one plan to an app subscription. */
export type AppSubscriptionLineItemInput = {
/** Defines the pricing model for the app subscription. */
plan: AppPlanInput;
};
/** Return type for `appSubscriptionLineItemUpdate` mutation. */
export type AppSubscriptionLineItemUpdatePayload = {
__typename?: 'AppSubscriptionLineItemUpdatePayload';
/** The updated app subscription. */
appSubscription?: Maybe<AppSubscription>;
/** The URL where the merchant approves or declines the updated app subscription line item. */
confirmationUrl?: Maybe<Scalars['URL']>;
/** List of errors that occurred executing the mutation. */
userErrors: Array<UserError>;
};
/** The set of valid sort keys for the AppSubscription query. */
export enum AppSubscriptionSortKeys {
/** Sort by the `created_at` value. */
CreatedAt = 'CREATED_AT',
/** Sort by the `id` value. */
Id = 'ID',
/**
* During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the
* results by relevance to the search term(s). When no search query is specified, this sort key is not
* deterministic and should not be used.
*/
Relevance = 'RELEVANCE'
}
/** The status of the app subscription. */
export enum AppSubscriptionStatus {
/** The app subscription is pending approval by the merchant. */
Pending = 'PENDING',
/** The app subscription has been approved by the merchant and is ready to be activated by the app. App subscriptions created through the GraphQL Admin API are activated upon approval. */
Accepted = 'ACCEPTED',
/** The app subscription has been activated by the app. Active app subscriptions are charged to the store and partners recieve payouts for active app subscriptions. */
Active = 'ACTIVE',
/** The app subscription was declined by the merchant. */
Declined = 'DECLINED',
/** The app subscription was not accepted within 2 days of being created. */
Expired = 'EXPIRED',
/** The app subscription is on hold due to a store subscription non-payment. The charge will re-activate once subscription payments resume. */
Frozen = 'FROZEN',
/** The app subscription was cancelled by the app. */
Cancelled = 'CANCELLED'
}
/** The set of valid sort keys for the AppTransaction query. */
export enum AppTransactionSortKeys {
/** Sort by the `created_at` value. */
CreatedAt = 'CREATED_AT',
/** Sort by the `id` value. */
Id = 'ID',
/**
* During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the
* results by relevance to the search term(s). When no search query is specified, this sort key is not
* deterministic and should not be used.
*/
Relevance = 'RELEVANCE'
}
/** Defines the usage pricing model for the app subscription. */
export type AppUsagePricing = {
__typename?: 'AppUsagePricing';
/** The total usage records for interval. */
balanceUsed: MoneyV2;
/** The limit a store can be charged for usage based pricing. */
cappedAmount: MoneyV2;
/** Specifies the interval which usage records are applied. */
interval: AppPricingInterval;
/** The terms and conditions for app usage pricing. */
terms: Scalars['String'];
};
/** Allows an app to charge a store for usage. */
export type AppUsagePricingInput = {
/** The limit a customer can be charged for usage based pricing. */
cappedAmount: MoneyInput;
/** The terms and conditions for app usage. */
terms: Scalars['String'];
};
/** Store usage for app subscriptions with usage pricing. */
export type AppUsageRecord = Node & {
__typename?: 'AppUsageRecord';
/** The date and time when the usage record was created. */
createdAt: Scalars['DateTime'];
/** The description of the app usage record. */
description: Scalars['String'];
/** Globally unique identifier. */
id: Scalars['ID'];
/** The price of the usage record. The only permitted currency code is USD. */
price: MoneyV2;
/** Defines the usage pricing plan the merchant is subscribed to. */
subscriptionLineItem: AppSubscriptionLineItem;
};
/** An auto-generated type for paginating through multiple AppUsageRecords. */
export type AppUsageRecordConnection = {
__typename?: 'AppUsageRecordConnection';
/** A list of edges. */
edges: Array<AppUsageRecordEdge>;
/** Information to aid in pagination. */
pageInfo: PageInfo;
};
/** Return type for `appUsageRecordCreate` mutation. */
export type AppUsageRecordCreatePayload = {
__typename?: 'AppUsageRecordCreatePayload';
/** The newly created app usage record. */
appUsageRecord?: Maybe<AppUsageRecord>;
/** List of errors that occurred executing the mutation. */
userErrors: Array<UserError>;
};
/** An auto-generated type which holds one AppUsageRecord and a cursor during pagination. */
export type AppUsageRecordEdge = {
__typename?: 'AppUsageRecordEdge';
/** A cursor for use in pagination. */
cursor: Scalars['String'];
/** The item at the end of AppUsageRecordEdge. */
node: AppUsageRecord;
};
/** The set of valid sort keys for the AppUsageRecord query. */
export enum AppUsageRecordSortKeys {
/** Sort by the `created_at` value. */
CreatedAt = 'CREATED_AT',
/** Sort by the `id` value. */
Id = 'ID',
/**
* During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the
* results by relevance to the search term(s). When no search query is specified, this sort key is not
* deterministic and should not be used.
*/
Relevance = 'RELEVANCE'
}
/** Represents a generic custom attribute. */
export type Attribute = {
__typename?: 'Attribute';
/** Key or name of the attribute. */
key: Scalars['String'];
/** Value of the attribute. */
value?: Maybe<Scalars['String']>;
};
/** Specifies the input fields required for an attribute. */
export type AttributeInput = {
/** Key or name of the attribute. */
key: Scalars['String'];
/** Value of the attribute. */
value: Scalars['String'];
};
/** Automatic discount applications capture the intentions of a discount that was automatically applied. */
export type AutomaticDiscountApplication = DiscountApplication & {
__typename?: 'AutomaticDiscountApplication';
/** The method by which the discount's value is allocated to its entitled items. */
allocationMethod: DiscountApplicationAllocationMethod;
/**
* An ordered index that can be used to identify the discount application and indicate the precedence
* of the discount application for calculations.
*/
index: Scalars['Int'];
/** How the discount amount is distributed on the discounted lines. */
targetSelection: DiscountApplicationTargetSelection;
/** Whether the discount is applied on line items or shipping lines. */
targetType: DiscountApplicationTargetType;
/** The title of the discount application. */
title: Scalars['String'];
/** The value of the discount application. */
value: PricingValue;
};
/** The set of valid sort keys for the AutomaticDiscount query. */
export enum AutomaticDiscountSortKeys {
/** Sort by the `created_at` value. */
CreatedAt = 'CREATED_AT',
/** Sort by the `id` value. */
Id = 'ID',
/**
* During a search (i.e. when the `query` parameter has been specified on the connection) this sorts the
* results by relevance to the search term(s). When no search query is specified, this sort key is not
* deterministic and should not be used.
*/
Relevance = 'RELEVANCE'
}
/**
* Basic events chronicle resource activities such as the creation of an article, the fulfillment of an order, or
* the addition of a product.
*/
export type BasicEvent = Node & Event & {
__typename?: 'BasicEvent';
/** The name of the app that created the event. Returns null when the event originates from the Shopify admin. */
appTitle?: Maybe<Scalars['String']>;
/** Whether the event was created by an app. */
attributeToApp: Scalars['Boolean'];
/** Whether the event was caused by an admin user. */
attributeToUser: Scalars['Boolean'];
/** The date and time when the event was created. */
createdAt: Scalars['DateTime'];
/** Whether the event is critical. */
criticalAlert: Scalars['Boolean'];
/** Globally unique identifier. */
id: Scalars['ID'];
/** Human readable text that describes the event. */
message: Scalars['FormattedString'];
};
/** Represents an error that happens during the execution of a billing attempt mutation. */
export type BillingAttemptUserError = DisplayableError & {
__typename?: 'BillingAttemptUserError';
/** Error code to uniquely identify the error. */
code?: Maybe<BillingAttemptUserErrorCode>;
/** Path to the input field which caused the error. */
field?: Maybe<Array<Scalars['String']>>;
/** The error message. */
message: Scalars['String'];
};
/** Possible error codes that could be returned by BillingAttemptUserError. */
export enum BillingAttemptUserErrorCode {
/** Input value is invalid. */
Invalid = 'INVALID',
/** Input value is blank. */
Blank = 'BLANK',
/** Subscription contract does not exist. */
ContractNotFound = 'CONTRACT_NOT_FOUND'
}
/**
* An asynchronous long-running operation to fetch data in bulk.
*
* Bulk operations are created using the `bulkOperationRunQuery` mutation. After they are created,
* clients should poll the `status` field for updates. When `COMPLETED`, the `url` field contains
* a link to the data in [JSONL](http://jsonlines.org/) format.
*
* See the [bulk operations guide](https://help.shopify.com/api/guides/bulk-operations) for more details.
*/
export type BulkOperation = Node & {
__typename?: 'BulkOperation';
/** When the bulk operation was successfully completed. */
completedAt?: Maybe<Scalars['DateTime']>;
/** When the bulk operation was created. */
createdAt: Scalars['DateTime'];
/** Error code for failed operations. */
errorCode?: Maybe<BulkOperationErrorCode>;
/** File size in bytes of the file in the `url` field. */
fileSize?: Maybe<Scalars['UnsignedInt64']>;
/** Globally unique identifier. */
id: Scalars['ID'];
/**
* The running count of all objects processed.
* For example, when fetching all products and their variants, this field counts both products and variants.
* This field can be used to track operation progress.
*/
objectCount: Scalars['UnsignedInt64'];
/**
* URL to partial/incomplete response data (in [JSONL](http://jsonlines.org/) format) returned by a failed operation.
* Expires **one week** after the operation fails. Returns `null` when there's no data available.
*/
partialDataUrl?: Maybe<Scalars['URL']>;
/** GraphQL query document specified in `bulkOperationRunQuery`. */
query: Scalars['String'];
/**
* The running count of all objects processed at the root of the query.
* For example, when fetching all products and their variants, this field counts only products.
* This field can be used to track operation progress.
*/
rootObjectCount: Scalars['UnsignedInt64'];
/** Status of the bulk operation. */
status: BulkOperationStatus;
/**
* URL to the response data in [JSONL](http://jsonlines.org/) format.
* Expires **one week** after the operation completes.
*/
url?: Maybe<Scalars['URL']>;
};
/** Return type for `bulkOperationCancel` mutation. */
export type BulkOperationCancelPayload = {
__typename?: 'BulkOperationCancelPayload';
/** The bulk operation to be canceled. */
bulkOperation?: Maybe<BulkOperation>;
/** List of errors that occurred executing the mutation. */
userErrors: Array<UserError>;
};
/** Error codes for failed bulk operations. */
export enum BulkOperationErrorCode {
/**
* The provided operation `query` returned access denied due to missing
* [access scopes](https://help.shopify.com/api/getting-started/authentication/oauth/scopes).
* Review the requested object permissions and execute the query as a normal non-bulk GraphQL request to see more details.
*/
AccessDenied = 'ACCESS_DENIED',
/** Operation resulted in partial or incomplete data due to internal server errors during execution. */
InternalServerError = 'INTERNAL_SERVER_ERROR',
/**
* Operation resulted in partial or incomplete data due to query timeouts during execution.
* In some cases, timeouts can be avoided by modifying your `query` to select fewer fields.
*/
Timeout = 'TIMEOUT'
}
/** Return type for `bulkOperationRunQuery` mutation. */
export type BulkOperationRunQueryPayload = {
__typename?: 'BulkOperationRunQueryPayload';
/** The newly created bulk operation. */
bulkOperation?: Maybe<BulkOperation>;
/** List of errors that occurred executing the mutation. */
userErrors: Array<UserError>;
};
/** Statuses of a bulk operation. */
export enum BulkOperationStatus {
/** Operation created. */
Created = 'CREATED',
/** Operation running. */
Running = 'RUNNING',
/** Operation completed. */
Completed = 'COMPLETED',
/** Operation canceling. */
Canceling = 'CANCELING',
/** Operation canceled. */
Canceled = 'CANCELED',
/** Operation failed. */
Failed = 'FAILED',
/** Operation URL has expired. */
Expired = 'EXPIRED'
}
/**
* Discount code applications capture the intentions of a discount code at
* the time that it is applied onto an order.
*/
export type CalculatedAutomaticDiscountApplication = CalculatedDiscountApplication & {
__typename?: 'CalculatedAutomaticDiscountApplication';
/** The method by which the discount's value is allocated to its entitled items. */
allocationMethod: DiscountApplicationAllocationMethod;
/** The level at which the discount was applied. */
appliedTo: DiscountApplicationLevel;
/** The description of discount application. Indicates the reason why the discount was applied. */
description?: Maybe<Scalars['String']>;
/** Globally unique identifier. */
id: Scalars['ID'];
/** How the discount amount is distributed on the discounted lines. */
targetSelection: DiscountApplicationTargetSelection;
/** Whether the discount is applied on line items or shipping lines. */
targetType: DiscountApplicationTargetType;
/** The value of the discount application. */
value: PricingValue;
};
/** An amount discounting the line that has been allocated by an associated discount application. */
export type CalculatedDiscountAllocation = {
__typename?: 'CalculatedDiscountAllocation';
/** The money amount allocated by the discount application in shop and presentment currencies. */
allocatedAmountSet: MoneyBag;
/** The discount that the allocated amount originated from. */
discountApplication: CalculatedDiscountApplication;
};
/** A discount application involved in order editing that might be newly added or have new changes applied. */
export type CalculatedDiscountApplication = {
/** The method by which the discount's value is allocated to its entitled items. */
allocationMethod: DiscountApplicationAllocationMethod;
/** The level at which the discount was applied. */
appliedTo: DiscountApplicationLevel;
/** The description of discount application. Indicates the reason why the discount was applied. */
description?: Maybe<Scalars['String']>;
/** Globally unique identifier. */
id: Scalars['ID'];
/** How the discount amount is distributed on the discounted lines. */
targetSelection: DiscountApplicationTargetSelection;
/** Whether the discount is applied on line items or shipping lines. */
targetType: DiscountApplicationTargetType;
/** The value of the discount application. */
value: PricingValue;
};
/** An auto-generated type for paginating through multiple CalculatedDiscountApplications. */
export type CalculatedDiscountApplicationConnection = {
__typename?: 'CalculatedDiscountApplicationConnection';
/** A list of edges. */
edges: Array<CalculatedDiscountApplicationEdge>;
/** Information to aid in pagination. */
pageInfo: PageInfo;
};
/** An auto-generated type which holds one CalculatedDiscountApplication and a cursor during pagination. */
export type CalculatedDiscountApplicationEdge = {
__typename?: 'CalculatedDiscountApplicationEdge';
/** A cursor for use in pagination. */
cursor: Scalars['String'];
/** The item at the end of CalculatedDiscountApplicationEdge. */
node: CalculatedDiscountApplication;
};
/**
* Discount code applications capture the intentions of a discount code at
* the time that it is applied onto an order.
*/
export type CalculatedDiscountCodeApplication = CalculatedDiscountApplication & {
__typename?: 'CalculatedDiscountCodeApplication';
/** The method by which the discount's value is allocated to its entitled items. */
allocationMethod: DiscountApplicationAllocationMethod;
/** The level at which the discount was applied. */
appliedTo: DiscountApplicationLevel;
/** The string identifying the discount code that was used at the time of application. */
code: Scalars['String'];
/** The description of discount application. Indicates the reason why the discount was applied. */
description?: Maybe<Scalars['String']>;
/** Globally unique identifier. */
id: Scalars['ID'];
/** How the discount amount is distributed on the discounted lines. */
targetSelection: DiscountApplicationTargetSelection;
/** Whether the discount is applied on line items or shipping lines. */
targetType: DiscountApplicationTargetType;
/** The value of the discount application. */
value: PricingValue;
};
/** The computed properties for a draft order. */
export type CalculatedDraftOrder = {
__typename?: 'CalculatedDraftOrder';
/** Order-level discount applied to the draft order. */
appliedDiscount?: Maybe<DraftOrderAppliedDiscount>;
/** The available shipping rates for the draft order. Requires a customer with a valid shipping address and at least one line item. */
availableShippingRates: Array<ShippingRate>;
/** Customer who will be sent an invoice for the draft order, if there is one. */
customer?: Maybe<Customer>;
/** Line items in the draft order with their computed properties. */
lineItems: Array<CalculatedDraftOrderLineItem>;
/** Line item that contains the shipping costs. */
shippingLine?: Maybe<ShippingLine>;
/** Subtotal of the line items and their discounts (does not contain shipping charges or shipping discounts, or taxes). */
subtotalPrice: Scalars['Money'];
/** Total amount of taxes charged for each line item and shipping line. */
taxLines: Array<TaxLine>;
/** Total amount of the draft order (includes taxes, shipping charges, and discounts). */
totalPrice: Scalars['Money'];
/** Total shipping charge for the draft order. */
totalShippingPrice: Scalars['Money'];
/** Total amount of taxes for the draft order. */
totalTax: Scalars['Money'];
};
/** The computed line items for a draft order. */
export type CalculatedDraftOrderLineItem = {
__typename?: 'CalculatedDraftOrderLineItem';
/** Discount applied to the line item. */
appliedDiscount?: Maybe<DraftOrderAppliedDiscount>;
/** Indicates if this is a product variant line item, or a custom line item. */
custom: Scalars['Boolean'];
/** List of additional information (metafields) about the line item. */
customAttributes: Array<Attribute>;
/** Total price with discounts applied. */
discountedTotal: MoneyV2;
/** Unit price with discounts applied. */
discountedUnitPrice: MoneyV2;
/**
* Name of the service provider who fulfilled the order.
*
* Valid values are either **manual** or the name of the provider.
* For example, **amazon**, **shipwire**.
*/
fulfillmentService: FulfillmentService;
/** Image associated with the draft order line item. */
image?: Maybe<Image>;
/** Indicates whether the line item represents the puchase of a gift card. */
isGiftCard: Scalars['Boolean'];
/** Name of the product. */
name: Scalars['String'];
/** Total price (without discounts) of the line item, based on the original unit price of the variant x quantity. */
originalTotal: MoneyV2;
/** Variant price without any discounts applied. */
originalUnitPrice: MoneyV2;
/** Product associated with the draft order line item. */
product?: Maybe<Product>;
/** Number of variant items requested in the draft order. */
quantity: Scalars['Int'];
/** Whether physical shipping is required for the variant. */
requiresShipping: Scalars['Boolean'];
/** Variant SKU number. */
sku?: Maybe<Scalars['String']>;
/** Whether the variant is taxable. */
taxable: Scalars['Boolean'];
/** Title of the product or variant (this field only applies to custom line items). */
title: Scalars['String'];
/** Total value of the discount. */
totalDiscount: MoneyV2;
/** Variant associated with the draft order line item. */
variant?: Maybe<ProductVariant>;
/** Name of the variant. */
variantTitle?: Maybe<Scalars['String']>;
/** Name of the vendor who made the variant. */
vendor?: Maybe<Scalars['String']>;
/** Weight unit and value for a draft order line item. */
weight?: Maybe<Weight>;
};
/** A line item involved in order editing that may be newly added or have new changes applied. */
export type CalculatedLineItem = {
__typename?: 'CalculatedLineItem';
/** The discounts that have been allocated onto the line item by discount applications. */
calculatedDiscountAllocations: Array<CalculatedDiscountAllocation>;
/** List of additional information (metafields) about the line item. */
customAttributes: Array<Attribute>;
/**
* The discounts that have been allocated onto the line item by discount applications.
* @deprecated Use `calculatedDiscountAllocations` instead
*/
discountAllocations: Array<DiscountAllocation>;
/** The total line price after discounts are applied in shop and presentment currencies. */
discountedUnitPriceSet: MoneyBag;
/** The total number of items that can be edited. */
editableQuantity: Scalars['Int'];
/** The editable quantity prior to any changes made in the current edit. */
editableQuantityBeforeChanges: Scalars['Int'];
/** The total price of editable lines in shop and presentment currencies. */
editableSubtotalSet: MoneyBag;
/** Whether the calculated line item has a staged discount. */
hasStagedLineItemDiscount: Scalars['Boolean'];
/** Globally unique identifier. */
id: Scalars['ID'];
/** The Image object associated to the line item's variant. */
image?: Maybe<Image>;
/** Variant price without any discounts applied in shop and presentment currencies. */
originalUnitPriceSet: MoneyBag;
/** The total number of items. */
quantity: Scalars['Int'];
/** Whether the line item can be restocked or not. */
restockable: Scalars['Boolean'];
/** Whether the changes on the line item will result in a restock. */
restocking: Scalars['Boolean'];
/** Variant SKU number. */
sku?: Maybe<Scalars['String']>;
/** A list of changes that affect this line item. */
stagedChanges: Array<OrderStagedChange>;
/** Title of the product or variant.