@shopify/cli-hydrogen 8.2.0 → 8.4.0
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/assets/hydrogen/i18n/domains.ts +4 -11
- package/dist/assets/hydrogen/i18n/mock-i18n-types.ts +4 -2
- package/dist/assets/hydrogen/i18n/subdomains.ts +4 -11
- package/dist/assets/hydrogen/i18n/subfolders.ts +4 -11
- package/dist/assets/hydrogen/starter/.graphqlrc.ts +27 -0
- package/dist/assets/hydrogen/starter/CHANGELOG.md +174 -0
- package/dist/assets/hydrogen/starter/app/components/CartLineItem.tsx +5 -2
- package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +2 -2
- package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +65 -19
- package/dist/assets/hydrogen/starter/app/components/PaginatedResourceSection.tsx +42 -0
- package/dist/assets/hydrogen/starter/app/components/SearchForm.tsx +68 -0
- package/dist/assets/hydrogen/starter/app/components/SearchFormPredictive.tsx +76 -0
- package/dist/assets/hydrogen/starter/app/components/SearchResults.tsx +164 -0
- package/dist/assets/hydrogen/starter/app/components/SearchResultsPredictive.tsx +322 -0
- package/dist/assets/hydrogen/starter/app/entry.client.tsx +10 -8
- package/dist/assets/hydrogen/starter/app/entry.server.tsx +1 -1
- package/dist/assets/hydrogen/starter/app/lib/context.ts +43 -0
- package/dist/assets/hydrogen/starter/app/lib/fragments.ts +53 -0
- package/dist/assets/hydrogen/starter/app/lib/search.ts +74 -24
- package/dist/assets/hydrogen/starter/app/root.tsx +4 -7
- package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +2 -3
- package/dist/assets/hydrogen/starter/app/routes/account.orders._index.tsx +5 -19
- package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +11 -24
- package/dist/assets/hydrogen/starter/app/routes/blogs._index.tsx +14 -27
- package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +12 -30
- package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +13 -27
- package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +9 -31
- package/dist/assets/hydrogen/starter/app/routes/search.tsx +312 -73
- package/dist/assets/hydrogen/starter/app/styles/reset.css +12 -2
- package/dist/assets/hydrogen/starter/env.d.ts +11 -30
- package/dist/assets/hydrogen/starter/guides/predictiveSearch/predictiveSearch.jpg +0 -0
- package/dist/assets/hydrogen/starter/guides/predictiveSearch/predictiveSearch.md +391 -0
- package/dist/assets/hydrogen/starter/guides/search/search.jpg +0 -0
- package/dist/assets/hydrogen/starter/guides/search/search.md +333 -0
- package/dist/assets/hydrogen/starter/package.json +4 -4
- package/dist/assets/hydrogen/starter/server.ts +18 -74
- package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +242 -172
- package/dist/assets/hydrogen/virtual-routes/components/{PageLayout.jsx → Layout.jsx} +2 -2
- package/dist/assets/hydrogen/virtual-routes/virtual-root.jsx +7 -6
- package/dist/commands/hydrogen/build.js +4 -2
- package/dist/commands/hydrogen/codegen.js +11 -3
- package/dist/commands/hydrogen/debug/cpu.js +2 -3
- package/dist/commands/hydrogen/deploy.js +8 -6
- package/dist/commands/hydrogen/dev.js +13 -11
- package/dist/commands/hydrogen/env/pull.js +5 -3
- package/dist/commands/hydrogen/env/push.js +2 -5
- package/dist/commands/hydrogen/login.js +4 -0
- package/dist/commands/hydrogen/logout.js +2 -0
- package/dist/commands/hydrogen/preview.js +11 -7
- package/dist/commands/hydrogen/setup.js +2 -4
- package/dist/hooks/init.js +6 -3
- package/dist/index.d.ts +5 -1
- package/dist/lib/auth.js +3 -63
- package/dist/lib/classic-compiler/dev.js +8 -4
- package/dist/lib/codegen.js +68 -33
- package/dist/lib/dev-shared.js +17 -15
- package/dist/lib/environment-variables.js +5 -4
- package/dist/lib/flags.js +7 -0
- package/dist/lib/import-utils.js +8 -2
- package/dist/lib/log.js +7 -38
- package/dist/lib/onboarding/common.js +2 -0
- package/dist/lib/onboarding/local.js +22 -7
- package/dist/lib/remix-config.js +8 -3
- package/dist/lib/setups/css/replacers.js +2 -2
- package/dist/lib/setups/i18n/index.js +3 -6
- package/dist/lib/setups/i18n/replacers.js +62 -134
- package/dist/lib/template-diff.js +15 -0
- package/dist/lib/transpile/morph/functions.js +3 -2
- package/dist/lib/transpile/morph/typedefs.js +4 -1
- package/dist/lib/vite-config.js +13 -1
- package/oclif.manifest.json +39 -2
- package/package.json +3 -3
- package/dist/assets/hydrogen/starter/.graphqlrc.yml +0 -12
- package/dist/assets/hydrogen/starter/app/components/Search.tsx +0 -514
- package/dist/assets/hydrogen/starter/app/routes/api.predictive-search.tsx +0 -318
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "skeleton",
|
|
3
3
|
"private": true,
|
|
4
4
|
"sideEffects": false,
|
|
5
|
-
"version": "2024.7.
|
|
5
|
+
"version": "2024.7.4",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "shopify hydrogen build --codegen",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@remix-run/react": "^2.10.1",
|
|
18
18
|
"@remix-run/server-runtime": "^2.10.1",
|
|
19
|
-
"@shopify/hydrogen": "2024.7.
|
|
20
|
-
"@shopify/remix-oxygen": "^2.0.
|
|
19
|
+
"@shopify/hydrogen": "2024.7.3",
|
|
20
|
+
"@shopify/remix-oxygen": "^2.0.6",
|
|
21
21
|
"graphql": "^16.6.0",
|
|
22
22
|
"graphql-tag": "^2.12.6",
|
|
23
23
|
"isbot": "^3.8.0",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@graphql-codegen/cli": "5.0.2",
|
|
29
29
|
"@remix-run/dev": "^2.10.1",
|
|
30
30
|
"@remix-run/eslint-config": "^2.10.1",
|
|
31
|
-
"@shopify/cli": "
|
|
31
|
+
"@shopify/cli": "3.65.1",
|
|
32
32
|
"@shopify/hydrogen-codegen": "^0.3.1",
|
|
33
33
|
"@shopify/mini-oxygen": "^3.0.4",
|
|
34
34
|
"@shopify/oxygen-workers-types": "^4.1.2",
|
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
// Virtual entry point for the app
|
|
3
3
|
import * as remixBuild from 'virtual:remix/server-build';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
createCartHandler,
|
|
8
|
-
createStorefrontClient,
|
|
9
|
-
storefrontRedirect,
|
|
10
|
-
createCustomerAccountClient,
|
|
11
|
-
} from '@shopify/hydrogen';
|
|
12
|
-
import {
|
|
13
|
-
createRequestHandler,
|
|
14
|
-
getStorefrontHeaders,
|
|
15
|
-
type AppLoadContext,
|
|
16
|
-
} from '@shopify/remix-oxygen';
|
|
17
|
-
import {AppSession} from '~/lib/session';
|
|
18
|
-
import {CART_QUERY_FRAGMENT} from '~/lib/fragments';
|
|
4
|
+
import {storefrontRedirect} from '@shopify/hydrogen';
|
|
5
|
+
import {createRequestHandler} from '@shopify/remix-oxygen';
|
|
6
|
+
import {createAppLoadContext} from '~/lib/context';
|
|
19
7
|
|
|
20
8
|
/**
|
|
21
9
|
* Export a fetch handler in module format.
|
|
@@ -27,55 +15,11 @@ export default {
|
|
|
27
15
|
executionContext: ExecutionContext,
|
|
28
16
|
): Promise<Response> {
|
|
29
17
|
try {
|
|
30
|
-
|
|
31
|
-
* Open a cache instance in the worker and a custom session instance.
|
|
32
|
-
*/
|
|
33
|
-
if (!env?.SESSION_SECRET) {
|
|
34
|
-
throw new Error('SESSION_SECRET environment variable is not set');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const waitUntil = executionContext.waitUntil.bind(executionContext);
|
|
38
|
-
const [cache, session] = await Promise.all([
|
|
39
|
-
caches.open('hydrogen'),
|
|
40
|
-
AppSession.init(request, [env.SESSION_SECRET]),
|
|
41
|
-
]);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Create Hydrogen's Storefront client.
|
|
45
|
-
*/
|
|
46
|
-
const {storefront} = createStorefrontClient({
|
|
47
|
-
cache,
|
|
48
|
-
waitUntil,
|
|
49
|
-
i18n: {language: 'EN', country: 'US'},
|
|
50
|
-
publicStorefrontToken: env.PUBLIC_STOREFRONT_API_TOKEN,
|
|
51
|
-
privateStorefrontToken: env.PRIVATE_STOREFRONT_API_TOKEN,
|
|
52
|
-
storeDomain: env.PUBLIC_STORE_DOMAIN,
|
|
53
|
-
storefrontId: env.PUBLIC_STOREFRONT_ID,
|
|
54
|
-
storefrontHeaders: getStorefrontHeaders(request),
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Create a client for Customer Account API.
|
|
59
|
-
*/
|
|
60
|
-
const customerAccount = createCustomerAccountClient({
|
|
61
|
-
waitUntil,
|
|
18
|
+
const appLoadContext = await createAppLoadContext(
|
|
62
19
|
request,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
/*
|
|
69
|
-
* Create a cart handler that will be used to
|
|
70
|
-
* create and update the cart in the session.
|
|
71
|
-
*/
|
|
72
|
-
const cart = createCartHandler({
|
|
73
|
-
storefront,
|
|
74
|
-
customerAccount,
|
|
75
|
-
getCartId: cartGetIdDefault(request.headers),
|
|
76
|
-
setCartId: cartSetIdDefault(),
|
|
77
|
-
cartQueryFragment: CART_QUERY_FRAGMENT,
|
|
78
|
-
});
|
|
20
|
+
env,
|
|
21
|
+
executionContext,
|
|
22
|
+
);
|
|
79
23
|
|
|
80
24
|
/**
|
|
81
25
|
* Create a Remix request handler and pass
|
|
@@ -84,20 +28,16 @@ export default {
|
|
|
84
28
|
const handleRequest = createRequestHandler({
|
|
85
29
|
build: remixBuild,
|
|
86
30
|
mode: process.env.NODE_ENV,
|
|
87
|
-
getLoadContext: ()
|
|
88
|
-
session,
|
|
89
|
-
storefront,
|
|
90
|
-
customerAccount,
|
|
91
|
-
cart,
|
|
92
|
-
env,
|
|
93
|
-
waitUntil,
|
|
94
|
-
}),
|
|
31
|
+
getLoadContext: () => appLoadContext,
|
|
95
32
|
});
|
|
96
33
|
|
|
97
34
|
const response = await handleRequest(request);
|
|
98
35
|
|
|
99
|
-
if (session.isPending) {
|
|
100
|
-
response.headers.set(
|
|
36
|
+
if (appLoadContext.session.isPending) {
|
|
37
|
+
response.headers.set(
|
|
38
|
+
'Set-Cookie',
|
|
39
|
+
await appLoadContext.session.commit(),
|
|
40
|
+
);
|
|
101
41
|
}
|
|
102
42
|
|
|
103
43
|
if (response.status === 404) {
|
|
@@ -106,7 +46,11 @@ export default {
|
|
|
106
46
|
* If the redirect doesn't exist, then `storefrontRedirect`
|
|
107
47
|
* will pass through the 404 response.
|
|
108
48
|
*/
|
|
109
|
-
return storefrontRedirect({
|
|
49
|
+
return storefrontRedirect({
|
|
50
|
+
request,
|
|
51
|
+
response,
|
|
52
|
+
storefront: appLoadContext.storefront,
|
|
53
|
+
});
|
|
110
54
|
}
|
|
111
55
|
|
|
112
56
|
return response;
|
|
@@ -38,6 +38,36 @@ export type CartLineFragment = Pick<
|
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
+
export type CartLineComponentFragment = Pick<
|
|
42
|
+
StorefrontAPI.ComponentizableCartLine,
|
|
43
|
+
'id' | 'quantity'
|
|
44
|
+
> & {
|
|
45
|
+
attributes: Array<Pick<StorefrontAPI.Attribute, 'key' | 'value'>>;
|
|
46
|
+
cost: {
|
|
47
|
+
totalAmount: Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>;
|
|
48
|
+
amountPerQuantity: Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>;
|
|
49
|
+
compareAtAmountPerQuantity?: StorefrontAPI.Maybe<
|
|
50
|
+
Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>
|
|
51
|
+
>;
|
|
52
|
+
};
|
|
53
|
+
merchandise: Pick<
|
|
54
|
+
StorefrontAPI.ProductVariant,
|
|
55
|
+
'id' | 'availableForSale' | 'requiresShipping' | 'title'
|
|
56
|
+
> & {
|
|
57
|
+
compareAtPrice?: StorefrontAPI.Maybe<
|
|
58
|
+
Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>
|
|
59
|
+
>;
|
|
60
|
+
price: Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>;
|
|
61
|
+
image?: StorefrontAPI.Maybe<
|
|
62
|
+
Pick<StorefrontAPI.Image, 'id' | 'url' | 'altText' | 'width' | 'height'>
|
|
63
|
+
>;
|
|
64
|
+
product: Pick<StorefrontAPI.Product, 'handle' | 'title' | 'id' | 'vendor'>;
|
|
65
|
+
selectedOptions: Array<
|
|
66
|
+
Pick<StorefrontAPI.SelectedOption, 'name' | 'value'>
|
|
67
|
+
>;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
41
71
|
export type CartApiQueryFragment = Pick<
|
|
42
72
|
StorefrontAPI.Cart,
|
|
43
73
|
'updatedAt' | 'id' | 'checkoutUrl' | 'totalQuantity' | 'note'
|
|
@@ -55,41 +85,76 @@ export type CartApiQueryFragment = Pick<
|
|
|
55
85
|
};
|
|
56
86
|
lines: {
|
|
57
87
|
nodes: Array<
|
|
58
|
-
Pick<StorefrontAPI.CartLine, 'id' | 'quantity'> & {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
| (Pick<StorefrontAPI.CartLine, 'id' | 'quantity'> & {
|
|
89
|
+
attributes: Array<Pick<StorefrontAPI.Attribute, 'key' | 'value'>>;
|
|
90
|
+
cost: {
|
|
91
|
+
totalAmount: Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>;
|
|
92
|
+
amountPerQuantity: Pick<
|
|
93
|
+
StorefrontAPI.MoneyV2,
|
|
94
|
+
'currencyCode' | 'amount'
|
|
95
|
+
>;
|
|
96
|
+
compareAtAmountPerQuantity?: StorefrontAPI.Maybe<
|
|
97
|
+
Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>
|
|
98
|
+
>;
|
|
99
|
+
};
|
|
100
|
+
merchandise: Pick<
|
|
101
|
+
StorefrontAPI.ProductVariant,
|
|
102
|
+
'id' | 'availableForSale' | 'requiresShipping' | 'title'
|
|
103
|
+
> & {
|
|
104
|
+
compareAtPrice?: StorefrontAPI.Maybe<
|
|
105
|
+
Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>
|
|
106
|
+
>;
|
|
107
|
+
price: Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>;
|
|
108
|
+
image?: StorefrontAPI.Maybe<
|
|
109
|
+
Pick<
|
|
110
|
+
StorefrontAPI.Image,
|
|
111
|
+
'id' | 'url' | 'altText' | 'width' | 'height'
|
|
112
|
+
>
|
|
113
|
+
>;
|
|
114
|
+
product: Pick<
|
|
115
|
+
StorefrontAPI.Product,
|
|
116
|
+
'handle' | 'title' | 'id' | 'vendor'
|
|
117
|
+
>;
|
|
118
|
+
selectedOptions: Array<
|
|
119
|
+
Pick<StorefrontAPI.SelectedOption, 'name' | 'value'>
|
|
120
|
+
>;
|
|
121
|
+
};
|
|
122
|
+
})
|
|
123
|
+
| (Pick<StorefrontAPI.ComponentizableCartLine, 'id' | 'quantity'> & {
|
|
124
|
+
attributes: Array<Pick<StorefrontAPI.Attribute, 'key' | 'value'>>;
|
|
125
|
+
cost: {
|
|
126
|
+
totalAmount: Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>;
|
|
127
|
+
amountPerQuantity: Pick<
|
|
128
|
+
StorefrontAPI.MoneyV2,
|
|
129
|
+
'currencyCode' | 'amount'
|
|
130
|
+
>;
|
|
131
|
+
compareAtAmountPerQuantity?: StorefrontAPI.Maybe<
|
|
132
|
+
Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>
|
|
133
|
+
>;
|
|
134
|
+
};
|
|
135
|
+
merchandise: Pick<
|
|
136
|
+
StorefrontAPI.ProductVariant,
|
|
137
|
+
'id' | 'availableForSale' | 'requiresShipping' | 'title'
|
|
138
|
+
> & {
|
|
139
|
+
compareAtPrice?: StorefrontAPI.Maybe<
|
|
140
|
+
Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>
|
|
141
|
+
>;
|
|
142
|
+
price: Pick<StorefrontAPI.MoneyV2, 'currencyCode' | 'amount'>;
|
|
143
|
+
image?: StorefrontAPI.Maybe<
|
|
144
|
+
Pick<
|
|
145
|
+
StorefrontAPI.Image,
|
|
146
|
+
'id' | 'url' | 'altText' | 'width' | 'height'
|
|
147
|
+
>
|
|
148
|
+
>;
|
|
149
|
+
product: Pick<
|
|
150
|
+
StorefrontAPI.Product,
|
|
151
|
+
'handle' | 'title' | 'id' | 'vendor'
|
|
152
|
+
>;
|
|
153
|
+
selectedOptions: Array<
|
|
154
|
+
Pick<StorefrontAPI.SelectedOption, 'name' | 'value'>
|
|
155
|
+
>;
|
|
156
|
+
};
|
|
157
|
+
})
|
|
93
158
|
>;
|
|
94
159
|
};
|
|
95
160
|
cost: {
|
|
@@ -326,123 +391,6 @@ export type RecommendedProductsQuery = {
|
|
|
326
391
|
};
|
|
327
392
|
};
|
|
328
393
|
|
|
329
|
-
export type PredictiveArticleFragment = {__typename: 'Article'} & Pick<
|
|
330
|
-
StorefrontAPI.Article,
|
|
331
|
-
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
332
|
-
> & {
|
|
333
|
-
blog: Pick<StorefrontAPI.Blog, 'handle'>;
|
|
334
|
-
image?: StorefrontAPI.Maybe<
|
|
335
|
-
Pick<StorefrontAPI.Image, 'url' | 'altText' | 'width' | 'height'>
|
|
336
|
-
>;
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
export type PredictiveCollectionFragment = {__typename: 'Collection'} & Pick<
|
|
340
|
-
StorefrontAPI.Collection,
|
|
341
|
-
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
342
|
-
> & {
|
|
343
|
-
image?: StorefrontAPI.Maybe<
|
|
344
|
-
Pick<StorefrontAPI.Image, 'url' | 'altText' | 'width' | 'height'>
|
|
345
|
-
>;
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
export type PredictivePageFragment = {__typename: 'Page'} & Pick<
|
|
349
|
-
StorefrontAPI.Page,
|
|
350
|
-
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
351
|
-
>;
|
|
352
|
-
|
|
353
|
-
export type PredictiveProductFragment = {__typename: 'Product'} & Pick<
|
|
354
|
-
StorefrontAPI.Product,
|
|
355
|
-
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
356
|
-
> & {
|
|
357
|
-
variants: {
|
|
358
|
-
nodes: Array<
|
|
359
|
-
Pick<StorefrontAPI.ProductVariant, 'id'> & {
|
|
360
|
-
image?: StorefrontAPI.Maybe<
|
|
361
|
-
Pick<StorefrontAPI.Image, 'url' | 'altText' | 'width' | 'height'>
|
|
362
|
-
>;
|
|
363
|
-
price: Pick<StorefrontAPI.MoneyV2, 'amount' | 'currencyCode'>;
|
|
364
|
-
}
|
|
365
|
-
>;
|
|
366
|
-
};
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
export type PredictiveQueryFragment = {
|
|
370
|
-
__typename: 'SearchQuerySuggestion';
|
|
371
|
-
} & Pick<
|
|
372
|
-
StorefrontAPI.SearchQuerySuggestion,
|
|
373
|
-
'text' | 'styledText' | 'trackingParameters'
|
|
374
|
-
>;
|
|
375
|
-
|
|
376
|
-
export type PredictiveSearchQueryVariables = StorefrontAPI.Exact<{
|
|
377
|
-
country?: StorefrontAPI.InputMaybe<StorefrontAPI.CountryCode>;
|
|
378
|
-
language?: StorefrontAPI.InputMaybe<StorefrontAPI.LanguageCode>;
|
|
379
|
-
limit: StorefrontAPI.Scalars['Int']['input'];
|
|
380
|
-
limitScope: StorefrontAPI.PredictiveSearchLimitScope;
|
|
381
|
-
searchTerm: StorefrontAPI.Scalars['String']['input'];
|
|
382
|
-
types?: StorefrontAPI.InputMaybe<
|
|
383
|
-
| Array<StorefrontAPI.PredictiveSearchType>
|
|
384
|
-
| StorefrontAPI.PredictiveSearchType
|
|
385
|
-
>;
|
|
386
|
-
}>;
|
|
387
|
-
|
|
388
|
-
export type PredictiveSearchQuery = {
|
|
389
|
-
predictiveSearch?: StorefrontAPI.Maybe<{
|
|
390
|
-
articles: Array<
|
|
391
|
-
{__typename: 'Article'} & Pick<
|
|
392
|
-
StorefrontAPI.Article,
|
|
393
|
-
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
394
|
-
> & {
|
|
395
|
-
blog: Pick<StorefrontAPI.Blog, 'handle'>;
|
|
396
|
-
image?: StorefrontAPI.Maybe<
|
|
397
|
-
Pick<StorefrontAPI.Image, 'url' | 'altText' | 'width' | 'height'>
|
|
398
|
-
>;
|
|
399
|
-
}
|
|
400
|
-
>;
|
|
401
|
-
collections: Array<
|
|
402
|
-
{__typename: 'Collection'} & Pick<
|
|
403
|
-
StorefrontAPI.Collection,
|
|
404
|
-
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
405
|
-
> & {
|
|
406
|
-
image?: StorefrontAPI.Maybe<
|
|
407
|
-
Pick<StorefrontAPI.Image, 'url' | 'altText' | 'width' | 'height'>
|
|
408
|
-
>;
|
|
409
|
-
}
|
|
410
|
-
>;
|
|
411
|
-
pages: Array<
|
|
412
|
-
{__typename: 'Page'} & Pick<
|
|
413
|
-
StorefrontAPI.Page,
|
|
414
|
-
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
415
|
-
>
|
|
416
|
-
>;
|
|
417
|
-
products: Array<
|
|
418
|
-
{__typename: 'Product'} & Pick<
|
|
419
|
-
StorefrontAPI.Product,
|
|
420
|
-
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
421
|
-
> & {
|
|
422
|
-
variants: {
|
|
423
|
-
nodes: Array<
|
|
424
|
-
Pick<StorefrontAPI.ProductVariant, 'id'> & {
|
|
425
|
-
image?: StorefrontAPI.Maybe<
|
|
426
|
-
Pick<
|
|
427
|
-
StorefrontAPI.Image,
|
|
428
|
-
'url' | 'altText' | 'width' | 'height'
|
|
429
|
-
>
|
|
430
|
-
>;
|
|
431
|
-
price: Pick<StorefrontAPI.MoneyV2, 'amount' | 'currencyCode'>;
|
|
432
|
-
}
|
|
433
|
-
>;
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
>;
|
|
437
|
-
queries: Array<
|
|
438
|
-
{__typename: 'SearchQuerySuggestion'} & Pick<
|
|
439
|
-
StorefrontAPI.SearchQuerySuggestion,
|
|
440
|
-
'text' | 'styledText' | 'trackingParameters'
|
|
441
|
-
>
|
|
442
|
-
>;
|
|
443
|
-
}>;
|
|
444
|
-
};
|
|
445
|
-
|
|
446
394
|
export type ArticleQueryVariables = StorefrontAPI.Exact<{
|
|
447
395
|
articleHandle: StorefrontAPI.Scalars['String']['input'];
|
|
448
396
|
blogHandle: StorefrontAPI.Scalars['String']['input'];
|
|
@@ -1053,7 +1001,12 @@ export type SearchArticleFragment = {__typename: 'Article'} & Pick<
|
|
|
1053
1001
|
'handle' | 'id' | 'title' | 'trackingParameters'
|
|
1054
1002
|
>;
|
|
1055
1003
|
|
|
1056
|
-
export type
|
|
1004
|
+
export type PageInfoFragmentFragment = Pick<
|
|
1005
|
+
StorefrontAPI.PageInfo,
|
|
1006
|
+
'hasNextPage' | 'hasPreviousPage' | 'startCursor' | 'endCursor'
|
|
1007
|
+
>;
|
|
1008
|
+
|
|
1009
|
+
export type RegularSearchQueryVariables = StorefrontAPI.Exact<{
|
|
1057
1010
|
country?: StorefrontAPI.InputMaybe<StorefrontAPI.CountryCode>;
|
|
1058
1011
|
endCursor?: StorefrontAPI.InputMaybe<
|
|
1059
1012
|
StorefrontAPI.Scalars['String']['input']
|
|
@@ -1061,13 +1014,29 @@ export type SearchQueryVariables = StorefrontAPI.Exact<{
|
|
|
1061
1014
|
first?: StorefrontAPI.InputMaybe<StorefrontAPI.Scalars['Int']['input']>;
|
|
1062
1015
|
language?: StorefrontAPI.InputMaybe<StorefrontAPI.LanguageCode>;
|
|
1063
1016
|
last?: StorefrontAPI.InputMaybe<StorefrontAPI.Scalars['Int']['input']>;
|
|
1064
|
-
|
|
1017
|
+
term: StorefrontAPI.Scalars['String']['input'];
|
|
1065
1018
|
startCursor?: StorefrontAPI.InputMaybe<
|
|
1066
1019
|
StorefrontAPI.Scalars['String']['input']
|
|
1067
1020
|
>;
|
|
1068
1021
|
}>;
|
|
1069
1022
|
|
|
1070
|
-
export type
|
|
1023
|
+
export type RegularSearchQuery = {
|
|
1024
|
+
articles: {
|
|
1025
|
+
nodes: Array<
|
|
1026
|
+
{__typename: 'Article'} & Pick<
|
|
1027
|
+
StorefrontAPI.Article,
|
|
1028
|
+
'handle' | 'id' | 'title' | 'trackingParameters'
|
|
1029
|
+
>
|
|
1030
|
+
>;
|
|
1031
|
+
};
|
|
1032
|
+
pages: {
|
|
1033
|
+
nodes: Array<
|
|
1034
|
+
{__typename: 'Page'} & Pick<
|
|
1035
|
+
StorefrontAPI.Page,
|
|
1036
|
+
'handle' | 'id' | 'title' | 'trackingParameters'
|
|
1037
|
+
>
|
|
1038
|
+
>;
|
|
1039
|
+
};
|
|
1071
1040
|
products: {
|
|
1072
1041
|
nodes: Array<
|
|
1073
1042
|
{__typename: 'Product'} & Pick<
|
|
@@ -1106,22 +1075,123 @@ export type SearchQuery = {
|
|
|
1106
1075
|
'hasNextPage' | 'hasPreviousPage' | 'startCursor' | 'endCursor'
|
|
1107
1076
|
>;
|
|
1108
1077
|
};
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1078
|
+
};
|
|
1079
|
+
|
|
1080
|
+
export type PredictiveArticleFragment = {__typename: 'Article'} & Pick<
|
|
1081
|
+
StorefrontAPI.Article,
|
|
1082
|
+
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
1083
|
+
> & {
|
|
1084
|
+
blog: Pick<StorefrontAPI.Blog, 'handle'>;
|
|
1085
|
+
image?: StorefrontAPI.Maybe<
|
|
1086
|
+
Pick<StorefrontAPI.Image, 'url' | 'altText' | 'width' | 'height'>
|
|
1115
1087
|
>;
|
|
1116
1088
|
};
|
|
1117
|
-
|
|
1118
|
-
|
|
1089
|
+
|
|
1090
|
+
export type PredictiveCollectionFragment = {__typename: 'Collection'} & Pick<
|
|
1091
|
+
StorefrontAPI.Collection,
|
|
1092
|
+
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
1093
|
+
> & {
|
|
1094
|
+
image?: StorefrontAPI.Maybe<
|
|
1095
|
+
Pick<StorefrontAPI.Image, 'url' | 'altText' | 'width' | 'height'>
|
|
1096
|
+
>;
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1099
|
+
export type PredictivePageFragment = {__typename: 'Page'} & Pick<
|
|
1100
|
+
StorefrontAPI.Page,
|
|
1101
|
+
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
1102
|
+
>;
|
|
1103
|
+
|
|
1104
|
+
export type PredictiveProductFragment = {__typename: 'Product'} & Pick<
|
|
1105
|
+
StorefrontAPI.Product,
|
|
1106
|
+
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
1107
|
+
> & {
|
|
1108
|
+
variants: {
|
|
1109
|
+
nodes: Array<
|
|
1110
|
+
Pick<StorefrontAPI.ProductVariant, 'id'> & {
|
|
1111
|
+
image?: StorefrontAPI.Maybe<
|
|
1112
|
+
Pick<StorefrontAPI.Image, 'url' | 'altText' | 'width' | 'height'>
|
|
1113
|
+
>;
|
|
1114
|
+
price: Pick<StorefrontAPI.MoneyV2, 'amount' | 'currencyCode'>;
|
|
1115
|
+
}
|
|
1116
|
+
>;
|
|
1117
|
+
};
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
export type PredictiveQueryFragment = {
|
|
1121
|
+
__typename: 'SearchQuerySuggestion';
|
|
1122
|
+
} & Pick<
|
|
1123
|
+
StorefrontAPI.SearchQuerySuggestion,
|
|
1124
|
+
'text' | 'styledText' | 'trackingParameters'
|
|
1125
|
+
>;
|
|
1126
|
+
|
|
1127
|
+
export type PredictiveSearchQueryVariables = StorefrontAPI.Exact<{
|
|
1128
|
+
country?: StorefrontAPI.InputMaybe<StorefrontAPI.CountryCode>;
|
|
1129
|
+
language?: StorefrontAPI.InputMaybe<StorefrontAPI.LanguageCode>;
|
|
1130
|
+
limit: StorefrontAPI.Scalars['Int']['input'];
|
|
1131
|
+
limitScope: StorefrontAPI.PredictiveSearchLimitScope;
|
|
1132
|
+
term: StorefrontAPI.Scalars['String']['input'];
|
|
1133
|
+
types?: StorefrontAPI.InputMaybe<
|
|
1134
|
+
| Array<StorefrontAPI.PredictiveSearchType>
|
|
1135
|
+
| StorefrontAPI.PredictiveSearchType
|
|
1136
|
+
>;
|
|
1137
|
+
}>;
|
|
1138
|
+
|
|
1139
|
+
export type PredictiveSearchQuery = {
|
|
1140
|
+
predictiveSearch?: StorefrontAPI.Maybe<{
|
|
1141
|
+
articles: Array<
|
|
1119
1142
|
{__typename: 'Article'} & Pick<
|
|
1120
1143
|
StorefrontAPI.Article,
|
|
1121
|
-
'
|
|
1144
|
+
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
1145
|
+
> & {
|
|
1146
|
+
blog: Pick<StorefrontAPI.Blog, 'handle'>;
|
|
1147
|
+
image?: StorefrontAPI.Maybe<
|
|
1148
|
+
Pick<StorefrontAPI.Image, 'url' | 'altText' | 'width' | 'height'>
|
|
1149
|
+
>;
|
|
1150
|
+
}
|
|
1151
|
+
>;
|
|
1152
|
+
collections: Array<
|
|
1153
|
+
{__typename: 'Collection'} & Pick<
|
|
1154
|
+
StorefrontAPI.Collection,
|
|
1155
|
+
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
1156
|
+
> & {
|
|
1157
|
+
image?: StorefrontAPI.Maybe<
|
|
1158
|
+
Pick<StorefrontAPI.Image, 'url' | 'altText' | 'width' | 'height'>
|
|
1159
|
+
>;
|
|
1160
|
+
}
|
|
1161
|
+
>;
|
|
1162
|
+
pages: Array<
|
|
1163
|
+
{__typename: 'Page'} & Pick<
|
|
1164
|
+
StorefrontAPI.Page,
|
|
1165
|
+
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
1122
1166
|
>
|
|
1123
1167
|
>;
|
|
1124
|
-
|
|
1168
|
+
products: Array<
|
|
1169
|
+
{__typename: 'Product'} & Pick<
|
|
1170
|
+
StorefrontAPI.Product,
|
|
1171
|
+
'id' | 'title' | 'handle' | 'trackingParameters'
|
|
1172
|
+
> & {
|
|
1173
|
+
variants: {
|
|
1174
|
+
nodes: Array<
|
|
1175
|
+
Pick<StorefrontAPI.ProductVariant, 'id'> & {
|
|
1176
|
+
image?: StorefrontAPI.Maybe<
|
|
1177
|
+
Pick<
|
|
1178
|
+
StorefrontAPI.Image,
|
|
1179
|
+
'url' | 'altText' | 'width' | 'height'
|
|
1180
|
+
>
|
|
1181
|
+
>;
|
|
1182
|
+
price: Pick<StorefrontAPI.MoneyV2, 'amount' | 'currencyCode'>;
|
|
1183
|
+
}
|
|
1184
|
+
>;
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
>;
|
|
1188
|
+
queries: Array<
|
|
1189
|
+
{__typename: 'SearchQuerySuggestion'} & Pick<
|
|
1190
|
+
StorefrontAPI.SearchQuerySuggestion,
|
|
1191
|
+
'text' | 'styledText' | 'trackingParameters'
|
|
1192
|
+
>
|
|
1193
|
+
>;
|
|
1194
|
+
}>;
|
|
1125
1195
|
};
|
|
1126
1196
|
|
|
1127
1197
|
interface GeneratedQueryTypes {
|
|
@@ -1149,10 +1219,6 @@ interface GeneratedQueryTypes {
|
|
|
1149
1219
|
return: RecommendedProductsQuery;
|
|
1150
1220
|
variables: RecommendedProductsQueryVariables;
|
|
1151
1221
|
};
|
|
1152
|
-
'#graphql\n fragment PredictiveArticle on Article {\n __typename\n id\n title\n handle\n blog {\n handle\n }\n image {\n url\n altText\n width\n height\n }\n trackingParameters\n }\n fragment PredictiveCollection on Collection {\n __typename\n id\n title\n handle\n image {\n url\n altText\n width\n height\n }\n trackingParameters\n }\n fragment PredictivePage on Page {\n __typename\n id\n title\n handle\n trackingParameters\n }\n fragment PredictiveProduct on Product {\n __typename\n id\n title\n handle\n trackingParameters\n variants(first: 1) {\n nodes {\n id\n image {\n url\n altText\n width\n height\n }\n price {\n amount\n currencyCode\n }\n }\n }\n }\n fragment PredictiveQuery on SearchQuerySuggestion {\n __typename\n text\n styledText\n trackingParameters\n }\n query predictiveSearch(\n $country: CountryCode\n $language: LanguageCode\n $limit: Int!\n $limitScope: PredictiveSearchLimitScope!\n $searchTerm: String!\n $types: [PredictiveSearchType!]\n ) @inContext(country: $country, language: $language) {\n predictiveSearch(\n limit: $limit,\n limitScope: $limitScope,\n query: $searchTerm,\n types: $types,\n ) {\n articles {\n ...PredictiveArticle\n }\n collections {\n ...PredictiveCollection\n }\n pages {\n ...PredictivePage\n }\n products {\n ...PredictiveProduct\n }\n queries {\n ...PredictiveQuery\n }\n }\n }\n': {
|
|
1153
|
-
return: PredictiveSearchQuery;
|
|
1154
|
-
variables: PredictiveSearchQueryVariables;
|
|
1155
|
-
};
|
|
1156
1222
|
'#graphql\n query Article(\n $articleHandle: String!\n $blogHandle: String!\n $country: CountryCode\n $language: LanguageCode\n ) @inContext(language: $language, country: $country) {\n blog(handle: $blogHandle) {\n articleByHandle(handle: $articleHandle) {\n title\n contentHtml\n publishedAt\n author: authorV2 {\n name\n }\n image {\n id\n altText\n url\n width\n height\n }\n seo {\n description\n title\n }\n }\n }\n }\n': {
|
|
1157
1223
|
return: ArticleQuery;
|
|
1158
1224
|
variables: ArticleQueryVariables;
|
|
@@ -1197,9 +1263,13 @@ interface GeneratedQueryTypes {
|
|
|
1197
1263
|
return: ProductVariantsQuery;
|
|
1198
1264
|
variables: ProductVariantsQueryVariables;
|
|
1199
1265
|
};
|
|
1200
|
-
'#graphql\n
|
|
1201
|
-
return:
|
|
1202
|
-
variables:
|
|
1266
|
+
'#graphql\n query RegularSearch(\n $country: CountryCode\n $endCursor: String\n $first: Int\n $language: LanguageCode\n $last: Int\n $term: String!\n $startCursor: String\n ) @inContext(country: $country, language: $language) {\n articles: search(\n query: $term,\n types: [ARTICLE],\n first: $first,\n ) {\n nodes {\n ...on Article {\n ...SearchArticle\n }\n }\n }\n pages: search(\n query: $term,\n types: [PAGE],\n first: $first,\n ) {\n nodes {\n ...on Page {\n ...SearchPage\n }\n }\n }\n products: search(\n after: $endCursor,\n before: $startCursor,\n first: $first,\n last: $last,\n query: $term,\n sortKey: RELEVANCE,\n types: [PRODUCT],\n unavailableProducts: HIDE,\n ) {\n nodes {\n ...on Product {\n ...SearchProduct\n }\n }\n pageInfo {\n ...PageInfoFragment\n }\n }\n }\n #graphql\n fragment SearchProduct on Product {\n __typename\n handle\n id\n publishedAt\n title\n trackingParameters\n vendor\n variants(first: 1) {\n nodes {\n id\n image {\n url\n altText\n width\n height\n }\n price {\n amount\n currencyCode\n }\n compareAtPrice {\n amount\n currencyCode\n }\n selectedOptions {\n name\n value\n }\n product {\n handle\n title\n }\n }\n }\n }\n\n #graphql\n fragment SearchPage on Page {\n __typename\n handle\n id\n title\n trackingParameters\n }\n\n #graphql\n fragment SearchArticle on Article {\n __typename\n handle\n id\n title\n trackingParameters\n }\n\n #graphql\n fragment PageInfoFragment on PageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n\n': {
|
|
1267
|
+
return: RegularSearchQuery;
|
|
1268
|
+
variables: RegularSearchQueryVariables;
|
|
1269
|
+
};
|
|
1270
|
+
'#graphql\n query PredictiveSearch(\n $country: CountryCode\n $language: LanguageCode\n $limit: Int!\n $limitScope: PredictiveSearchLimitScope!\n $term: String!\n $types: [PredictiveSearchType!]\n ) @inContext(country: $country, language: $language) {\n predictiveSearch(\n limit: $limit,\n limitScope: $limitScope,\n query: $term,\n types: $types,\n ) {\n articles {\n ...PredictiveArticle\n }\n collections {\n ...PredictiveCollection\n }\n pages {\n ...PredictivePage\n }\n products {\n ...PredictiveProduct\n }\n queries {\n ...PredictiveQuery\n }\n }\n }\n #graphql\n fragment PredictiveArticle on Article {\n __typename\n id\n title\n handle\n blog {\n handle\n }\n image {\n url\n altText\n width\n height\n }\n trackingParameters\n }\n\n #graphql\n fragment PredictiveCollection on Collection {\n __typename\n id\n title\n handle\n image {\n url\n altText\n width\n height\n }\n trackingParameters\n }\n\n #graphql\n fragment PredictivePage on Page {\n __typename\n id\n title\n handle\n trackingParameters\n }\n\n #graphql\n fragment PredictiveProduct on Product {\n __typename\n id\n title\n handle\n trackingParameters\n variants(first: 1) {\n nodes {\n id\n image {\n url\n altText\n width\n height\n }\n price {\n amount\n currencyCode\n }\n }\n }\n }\n\n #graphql\n fragment PredictiveQuery on SearchQuerySuggestion {\n __typename\n text\n styledText\n trackingParameters\n }\n\n': {
|
|
1271
|
+
return: PredictiveSearchQuery;
|
|
1272
|
+
variables: PredictiveSearchQueryVariables;
|
|
1203
1273
|
};
|
|
1204
1274
|
}
|
|
1205
1275
|
|