@shopify/hydrogen-react 0.0.0-next-ea3e88e → 0.0.0-next-9bff83c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-dev/ShopPayButton.mjs +1 -1
- package/dist/browser-dev/ShopPayButton.mjs.map +1 -1
- package/dist/browser-dev/ShopifyProvider.mjs +2 -11
- package/dist/browser-dev/ShopifyProvider.mjs.map +1 -1
- package/dist/browser-dev/cart-queries.mjs +0 -8
- package/dist/browser-dev/cart-queries.mjs.map +1 -1
- package/dist/browser-prod/ShopPayButton.mjs +1 -1
- package/dist/browser-prod/ShopPayButton.mjs.map +1 -1
- package/dist/browser-prod/ShopifyProvider.mjs +2 -8
- package/dist/browser-prod/ShopifyProvider.mjs.map +1 -1
- package/dist/browser-prod/cart-queries.mjs +0 -8
- package/dist/browser-prod/cart-queries.mjs.map +1 -1
- package/dist/node-dev/ShopPayButton.js +1 -1
- package/dist/node-dev/ShopPayButton.js.map +1 -1
- package/dist/node-dev/ShopPayButton.mjs +1 -1
- package/dist/node-dev/ShopPayButton.mjs.map +1 -1
- package/dist/node-dev/ShopifyProvider.js +2 -11
- package/dist/node-dev/ShopifyProvider.js.map +1 -1
- package/dist/node-dev/ShopifyProvider.mjs +2 -11
- package/dist/node-dev/ShopifyProvider.mjs.map +1 -1
- package/dist/node-dev/cart-queries.js +0 -8
- package/dist/node-dev/cart-queries.js.map +1 -1
- package/dist/node-dev/cart-queries.mjs +0 -8
- package/dist/node-dev/cart-queries.mjs.map +1 -1
- package/dist/node-prod/ShopPayButton.js +1 -1
- package/dist/node-prod/ShopPayButton.js.map +1 -1
- package/dist/node-prod/ShopPayButton.mjs +1 -1
- package/dist/node-prod/ShopPayButton.mjs.map +1 -1
- package/dist/node-prod/ShopifyProvider.js +2 -8
- package/dist/node-prod/ShopifyProvider.js.map +1 -1
- package/dist/node-prod/ShopifyProvider.mjs +2 -8
- package/dist/node-prod/ShopifyProvider.mjs.map +1 -1
- package/dist/node-prod/cart-queries.js +0 -8
- package/dist/node-prod/cart-queries.js.map +1 -1
- package/dist/node-prod/cart-queries.mjs +0 -8
- package/dist/node-prod/cart-queries.mjs.map +1 -1
- package/dist/types/ShopifyProvider.d.ts +1 -1
- package/dist/types/cart-queries.d.ts +1 -1
- package/dist/types/storefront-api-types.d.ts +121 -2
- package/dist/umd/hydrogen-react.dev.js +4 -21
- package/dist/umd/hydrogen-react.dev.js.map +1 -1
- package/dist/umd/hydrogen-react.prod.js +10 -18
- package/dist/umd/hydrogen-react.prod.js.map +1 -1
- package/package.json +1 -1
- package/storefront.schema.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE IS AUTO-GENERATED, DO NOT EDIT
|
|
3
|
-
* Based on Storefront API
|
|
4
|
-
* If changes need to happen to the types defined in this file, then generally the Storefront API needs to update
|
|
3
|
+
* Based on Storefront API 2023-01
|
|
4
|
+
* If changes need to happen to the types defined in this file, then generally the Storefront API needs to update. After it's updated, you can run `yarn graphql-types`.
|
|
5
5
|
* Except custom Scalars, which are defined in the `codegen.ts` file
|
|
6
6
|
*/
|
|
7
7
|
/* eslint-disable */
|
|
@@ -1312,6 +1312,8 @@ export type CheckoutErrorCode =
|
|
|
1312
1312
|
| 'CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE'
|
|
1313
1313
|
/** Discount already applied. */
|
|
1314
1314
|
| 'DISCOUNT_ALREADY_APPLIED'
|
|
1315
|
+
/** Discount code isn't working right now. Please contact us for help. */
|
|
1316
|
+
| 'DISCOUNT_CODE_APPLICATION_FAILED'
|
|
1315
1317
|
/** Discount disabled. */
|
|
1316
1318
|
| 'DISCOUNT_DISABLED'
|
|
1317
1319
|
/** Discount expired. */
|
|
@@ -4331,6 +4333,7 @@ export type MetafieldReference =
|
|
|
4331
4333
|
| Collection
|
|
4332
4334
|
| GenericFile
|
|
4333
4335
|
| MediaImage
|
|
4336
|
+
| Metaobject
|
|
4334
4337
|
| Page
|
|
4335
4338
|
| Product
|
|
4336
4339
|
| ProductVariant
|
|
@@ -4362,6 +4365,93 @@ export type MetafieldReferenceEdge = {
|
|
|
4362
4365
|
node: MetafieldReference;
|
|
4363
4366
|
};
|
|
4364
4367
|
|
|
4368
|
+
/** An instance of a user-defined model based on a MetaobjectDefinition. */
|
|
4369
|
+
export type Metaobject = Node & {
|
|
4370
|
+
__typename?: 'Metaobject';
|
|
4371
|
+
/** Accesses a field of the object by key. */
|
|
4372
|
+
field?: Maybe<MetaobjectField>;
|
|
4373
|
+
/**
|
|
4374
|
+
* All object fields with defined values.
|
|
4375
|
+
* Omitted object keys can be assumed null, and no guarantees are made about field order.
|
|
4376
|
+
*
|
|
4377
|
+
*/
|
|
4378
|
+
fields: Array<MetaobjectField>;
|
|
4379
|
+
/** The unique handle of the metaobject. Useful as a custom ID. */
|
|
4380
|
+
handle: Scalars['String'];
|
|
4381
|
+
/** A globally-unique identifier. */
|
|
4382
|
+
id: Scalars['ID'];
|
|
4383
|
+
/** The type of the metaobject. Defines the namespace of its associated metafields. */
|
|
4384
|
+
type: Scalars['String'];
|
|
4385
|
+
/** The date and time when the metaobject was last updated. */
|
|
4386
|
+
updatedAt: Scalars['DateTime'];
|
|
4387
|
+
};
|
|
4388
|
+
|
|
4389
|
+
/** An instance of a user-defined model based on a MetaobjectDefinition. */
|
|
4390
|
+
export type MetaobjectFieldArgs = {
|
|
4391
|
+
key: Scalars['String'];
|
|
4392
|
+
};
|
|
4393
|
+
|
|
4394
|
+
/**
|
|
4395
|
+
* An auto-generated type for paginating through multiple Metaobjects.
|
|
4396
|
+
*
|
|
4397
|
+
*/
|
|
4398
|
+
export type MetaobjectConnection = {
|
|
4399
|
+
__typename?: 'MetaobjectConnection';
|
|
4400
|
+
/** A list of edges. */
|
|
4401
|
+
edges: Array<MetaobjectEdge>;
|
|
4402
|
+
/** A list of the nodes contained in MetaobjectEdge. */
|
|
4403
|
+
nodes: Array<Metaobject>;
|
|
4404
|
+
/** Information to aid in pagination. */
|
|
4405
|
+
pageInfo: PageInfo;
|
|
4406
|
+
};
|
|
4407
|
+
|
|
4408
|
+
/**
|
|
4409
|
+
* An auto-generated type which holds one Metaobject and a cursor during pagination.
|
|
4410
|
+
*
|
|
4411
|
+
*/
|
|
4412
|
+
export type MetaobjectEdge = {
|
|
4413
|
+
__typename?: 'MetaobjectEdge';
|
|
4414
|
+
/** A cursor for use in pagination. */
|
|
4415
|
+
cursor: Scalars['String'];
|
|
4416
|
+
/** The item at the end of MetaobjectEdge. */
|
|
4417
|
+
node: Metaobject;
|
|
4418
|
+
};
|
|
4419
|
+
|
|
4420
|
+
/** Provides the value of a Metaobject field. */
|
|
4421
|
+
export type MetaobjectField = {
|
|
4422
|
+
__typename?: 'MetaobjectField';
|
|
4423
|
+
/** The field key. */
|
|
4424
|
+
key: Scalars['String'];
|
|
4425
|
+
/** A referenced object if the field type is a resource reference. */
|
|
4426
|
+
reference?: Maybe<MetafieldReference>;
|
|
4427
|
+
/** A list of referenced objects if the field type is a resource reference list. */
|
|
4428
|
+
references?: Maybe<MetafieldReferenceConnection>;
|
|
4429
|
+
/**
|
|
4430
|
+
* The type name of the field.
|
|
4431
|
+
* See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types).
|
|
4432
|
+
*
|
|
4433
|
+
*/
|
|
4434
|
+
type: Scalars['String'];
|
|
4435
|
+
/** The field value. */
|
|
4436
|
+
value?: Maybe<Scalars['String']>;
|
|
4437
|
+
};
|
|
4438
|
+
|
|
4439
|
+
/** Provides the value of a Metaobject field. */
|
|
4440
|
+
export type MetaobjectFieldReferencesArgs = {
|
|
4441
|
+
after?: InputMaybe<Scalars['String']>;
|
|
4442
|
+
before?: InputMaybe<Scalars['String']>;
|
|
4443
|
+
first?: InputMaybe<Scalars['Int']>;
|
|
4444
|
+
last?: InputMaybe<Scalars['Int']>;
|
|
4445
|
+
};
|
|
4446
|
+
|
|
4447
|
+
/** The input fields used to retrieve a metaobject by handle. */
|
|
4448
|
+
export type MetaobjectHandleInput = {
|
|
4449
|
+
/** The handle of the metaobject. */
|
|
4450
|
+
handle: Scalars['String'];
|
|
4451
|
+
/** The type of the metaobject. */
|
|
4452
|
+
type: Scalars['String'];
|
|
4453
|
+
};
|
|
4454
|
+
|
|
4365
4455
|
/** Represents a Shopify hosted 3D model. */
|
|
4366
4456
|
export type Model3d = Media &
|
|
4367
4457
|
Node & {
|
|
@@ -4820,6 +4910,8 @@ export type Order = HasMetafields &
|
|
|
4820
4910
|
currentTotalPrice: MoneyV2;
|
|
4821
4911
|
/** The total of all taxes applied to the order, excluding taxes for returned line items. */
|
|
4822
4912
|
currentTotalTax: MoneyV2;
|
|
4913
|
+
/** A list of the custom attributes added to the order. */
|
|
4914
|
+
customAttributes: Array<Attribute>;
|
|
4823
4915
|
/** The locale code in which this specific order happened. */
|
|
4824
4916
|
customerLocale?: Maybe<Scalars['String']>;
|
|
4825
4917
|
/** The unique URL that the customer can use to access the order. */
|
|
@@ -5539,6 +5631,8 @@ export type ProductFilter = {
|
|
|
5539
5631
|
productType?: InputMaybe<Scalars['String']>;
|
|
5540
5632
|
/** The product vendor to filter on. */
|
|
5541
5633
|
productVendor?: InputMaybe<Scalars['String']>;
|
|
5634
|
+
/** A product tag to filter on. */
|
|
5635
|
+
tag?: InputMaybe<Scalars['String']>;
|
|
5542
5636
|
/** A variant metafield to filter on. */
|
|
5543
5637
|
variantMetafield?: InputMaybe<MetafieldFilter>;
|
|
5544
5638
|
/** A variant option to filter on. */
|
|
@@ -5713,6 +5807,7 @@ export type ProductVariantStoreAvailabilityArgs = {
|
|
|
5713
5807
|
before?: InputMaybe<Scalars['String']>;
|
|
5714
5808
|
first?: InputMaybe<Scalars['Int']>;
|
|
5715
5809
|
last?: InputMaybe<Scalars['Int']>;
|
|
5810
|
+
near?: InputMaybe<GeoCoordinateInput>;
|
|
5716
5811
|
reverse?: InputMaybe<Scalars['Boolean']>;
|
|
5717
5812
|
};
|
|
5718
5813
|
|
|
@@ -5801,6 +5896,10 @@ export type QueryRoot = {
|
|
|
5801
5896
|
locations: LocationConnection;
|
|
5802
5897
|
/** A storefront menu. */
|
|
5803
5898
|
menu?: Maybe<Menu>;
|
|
5899
|
+
/** Fetch a specific Metaobject by one of its unique identifiers. */
|
|
5900
|
+
metaobject?: Maybe<Metaobject>;
|
|
5901
|
+
/** All active metaobjects for the shop. */
|
|
5902
|
+
metaobjects: MetaobjectConnection;
|
|
5804
5903
|
/** Returns a specific node by ID. */
|
|
5805
5904
|
node?: Maybe<
|
|
5806
5905
|
| AppliedGiftCard
|
|
@@ -5820,6 +5919,7 @@ export type QueryRoot = {
|
|
|
5820
5919
|
| Menu
|
|
5821
5920
|
| MenuItem
|
|
5822
5921
|
| Metafield
|
|
5922
|
+
| Metaobject
|
|
5823
5923
|
| Model3d
|
|
5824
5924
|
| Order
|
|
5825
5925
|
| Page
|
|
@@ -5852,6 +5952,7 @@ export type QueryRoot = {
|
|
|
5852
5952
|
| Menu
|
|
5853
5953
|
| MenuItem
|
|
5854
5954
|
| Metafield
|
|
5955
|
+
| Metaobject
|
|
5855
5956
|
| Model3d
|
|
5856
5957
|
| Order
|
|
5857
5958
|
| Page
|
|
@@ -5987,6 +6088,23 @@ export type QueryRootMenuArgs = {
|
|
|
5987
6088
|
handle: Scalars['String'];
|
|
5988
6089
|
};
|
|
5989
6090
|
|
|
6091
|
+
/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */
|
|
6092
|
+
export type QueryRootMetaobjectArgs = {
|
|
6093
|
+
handle?: InputMaybe<MetaobjectHandleInput>;
|
|
6094
|
+
id?: InputMaybe<Scalars['ID']>;
|
|
6095
|
+
};
|
|
6096
|
+
|
|
6097
|
+
/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */
|
|
6098
|
+
export type QueryRootMetaobjectsArgs = {
|
|
6099
|
+
after?: InputMaybe<Scalars['String']>;
|
|
6100
|
+
before?: InputMaybe<Scalars['String']>;
|
|
6101
|
+
first?: InputMaybe<Scalars['Int']>;
|
|
6102
|
+
last?: InputMaybe<Scalars['Int']>;
|
|
6103
|
+
reverse?: InputMaybe<Scalars['Boolean']>;
|
|
6104
|
+
sortKey?: InputMaybe<Scalars['String']>;
|
|
6105
|
+
type: Scalars['String'];
|
|
6106
|
+
};
|
|
6107
|
+
|
|
5990
6108
|
/** The schema’s entry-point for queries. This acts as the public, top-level API from which all queries must start. */
|
|
5991
6109
|
export type QueryRootNodeArgs = {
|
|
5992
6110
|
id: Scalars['ID'];
|
|
@@ -6062,6 +6180,7 @@ export type QueryRootUrlRedirectsArgs = {
|
|
|
6062
6180
|
before?: InputMaybe<Scalars['String']>;
|
|
6063
6181
|
first?: InputMaybe<Scalars['Int']>;
|
|
6064
6182
|
last?: InputMaybe<Scalars['Int']>;
|
|
6183
|
+
query?: InputMaybe<Scalars['String']>;
|
|
6065
6184
|
reverse?: InputMaybe<Scalars['Boolean']>;
|
|
6066
6185
|
};
|
|
6067
6186
|
|
|
@@ -846,17 +846,9 @@
|
|
|
846
846
|
compareAtPrice {
|
|
847
847
|
...MoneyFragment
|
|
848
848
|
}
|
|
849
|
-
# @deprecated remove in next major
|
|
850
|
-
compareAtPriceV2 {
|
|
851
|
-
...MoneyFragment
|
|
852
|
-
}
|
|
853
849
|
price {
|
|
854
850
|
...MoneyFragment
|
|
855
851
|
}
|
|
856
|
-
# @deprecated remove in next major
|
|
857
|
-
priceV2 {
|
|
858
|
-
...MoneyFragment
|
|
859
|
-
}
|
|
860
852
|
requiresShipping
|
|
861
853
|
title
|
|
862
854
|
image {
|
|
@@ -1031,21 +1023,12 @@
|
|
|
1031
1023
|
console.warn(`<ShopifyProvider/>: This version of Hydrogen-UI is built for Shopify's Storefront API version ${SFAPI_VERSION}, but it looks like you're using version ${shopifyConfig.storefrontApiVersion}. There may be issues or bugs if you use a mismatched version of Hydrogen-UI and the Storefront API.`);
|
|
1032
1024
|
}
|
|
1033
1025
|
const finalConfig = React.useMemo(() => {
|
|
1034
|
-
const storeDomain = shopifyConfig.storeDomain.replace(/^https?:\/\//, "");
|
|
1035
|
-
if (storeDomain.includes(".myshopify.com")) {
|
|
1036
|
-
{
|
|
1037
|
-
console.warn(`<ShopifyProvider/>: passing a 'storeDomain' prop that includes '.myshopify.com' will be unsupported in the future. Passing only the subdomain (for example, if the URL is 'test.myshopify.com', passing in 'test') will be the supported way going forward.`);
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
1026
|
function getShopifyDomain(overrideProps) {
|
|
1041
1027
|
var _a;
|
|
1042
|
-
|
|
1043
|
-
subDomain = subDomain.replace(".myshopify.com", "");
|
|
1044
|
-
return `https://${subDomain}.myshopify.com`;
|
|
1028
|
+
return (_a = overrideProps == null ? void 0 : overrideProps.storeDomain) != null ? _a : shopifyConfig.storeDomain;
|
|
1045
1029
|
}
|
|
1046
1030
|
return {
|
|
1047
1031
|
...shopifyConfig,
|
|
1048
|
-
storeDomain,
|
|
1049
1032
|
getPublicTokenHeaders(overrideProps) {
|
|
1050
1033
|
var _a;
|
|
1051
1034
|
return getPublicTokenHeadersRaw(overrideProps.contentType, shopifyConfig.storefrontApiVersion, (_a = overrideProps.storefrontToken) != null ? _a : shopifyConfig.storefrontToken);
|
|
@@ -1059,7 +1042,7 @@
|
|
|
1059
1042
|
}
|
|
1060
1043
|
}
|
|
1061
1044
|
return `${getShopifyDomain({
|
|
1062
|
-
storeDomain: (_b = overrideProps == null ? void 0 : overrideProps.storeDomain) != null ? _b : storeDomain
|
|
1045
|
+
storeDomain: (_b = overrideProps == null ? void 0 : overrideProps.storeDomain) != null ? _b : shopifyConfig.storeDomain
|
|
1063
1046
|
})}/api/${(_c = overrideProps == null ? void 0 : overrideProps.storefrontApiVersion) != null ? _c : shopifyConfig.storefrontApiVersion}/graphql.json`;
|
|
1064
1047
|
}
|
|
1065
1048
|
};
|
|
@@ -1069,7 +1052,7 @@
|
|
|
1069
1052
|
__self: this,
|
|
1070
1053
|
__source: {
|
|
1071
1054
|
fileName: _jsxFileName$f,
|
|
1072
|
-
lineNumber:
|
|
1055
|
+
lineNumber: 84,
|
|
1073
1056
|
columnNumber: 5
|
|
1074
1057
|
}
|
|
1075
1058
|
}, children);
|
|
@@ -3517,7 +3500,7 @@
|
|
|
3517
3500
|
columnNumber: 5
|
|
3518
3501
|
}
|
|
3519
3502
|
}, shopPayLoadedStatus === "done" && /* @__PURE__ */ React__default.default.createElement("shop-pay-button", {
|
|
3520
|
-
"store-url":
|
|
3503
|
+
"store-url": storeDomain,
|
|
3521
3504
|
variants: ids.join(","),
|
|
3522
3505
|
__self: this,
|
|
3523
3506
|
__source: {
|