@shopify/hydrogen 0.13.0 → 0.14.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.
Files changed (57) hide show
  1. package/CHANGELOG.md +51 -5
  2. package/dist/esnext/components/Link/Link.client.d.ts +6 -0
  3. package/dist/esnext/components/Link/Link.client.js +85 -3
  4. package/dist/esnext/components/LocalizationProvider/LocalizationContext.client.d.ts +1 -1
  5. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.d.ts +16 -0
  6. package/dist/esnext/components/LocalizationProvider/LocalizationProvider.server.js +7 -2
  7. package/dist/esnext/components/Seo/DefaultPageSeo.client.js +1 -2
  8. package/dist/esnext/entry-client.js +14 -1
  9. package/dist/esnext/entry-server.d.ts +1 -0
  10. package/dist/esnext/entry-server.js +15 -9
  11. package/dist/esnext/foundation/ServerRequestProvider/ServerRequestProvider.js +1 -1
  12. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.d.ts +6 -1
  13. package/dist/esnext/foundation/ServerStateProvider/ServerStateProvider.js +27 -22
  14. package/dist/esnext/foundation/ShopifyProvider/ShopifyProvider.server.js +4 -1
  15. package/dist/esnext/foundation/ShopifyProvider/types.d.ts +3 -1
  16. package/dist/esnext/foundation/constants.d.ts +1 -1
  17. package/dist/esnext/foundation/constants.js +1 -1
  18. package/dist/esnext/foundation/useQuery/hooks.d.ts +3 -0
  19. package/dist/esnext/foundation/useQuery/hooks.js +8 -2
  20. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.d.ts +7 -0
  21. package/dist/esnext/framework/Hydration/ServerComponentRequest.server.js +24 -7
  22. package/dist/esnext/framework/cache/in-memory.d.ts +1 -0
  23. package/dist/esnext/framework/cache/in-memory.js +15 -5
  24. package/dist/esnext/framework/cache.d.ts +0 -8
  25. package/dist/esnext/framework/cache.js +0 -8
  26. package/dist/esnext/hooks/useParsedMetafields/useParsedMetafields.d.ts +1 -1
  27. package/dist/esnext/hooks/useShopQuery/hooks.d.ts +1 -1
  28. package/dist/esnext/hooks/useShopQuery/hooks.js +33 -12
  29. package/dist/esnext/platforms/node.d.ts +2 -3
  30. package/dist/esnext/platforms/node.js +5 -3
  31. package/dist/esnext/platforms/worker.js +2 -1
  32. package/dist/esnext/storefront-api-types.d.ts +150 -3
  33. package/dist/esnext/storefront-api-types.js +16 -0
  34. package/dist/esnext/utilities/apiRoutes.js +3 -1
  35. package/dist/esnext/utilities/flattenConnection/flattenConnection.js +2 -5
  36. package/dist/esnext/version.d.ts +1 -1
  37. package/dist/esnext/version.js +1 -1
  38. package/dist/node/entry-server.d.ts +1 -0
  39. package/dist/node/entry-server.js +15 -9
  40. package/dist/node/foundation/ServerRequestProvider/ServerRequestProvider.js +1 -1
  41. package/dist/node/foundation/ServerStateProvider/ServerStateProvider.d.ts +6 -1
  42. package/dist/node/foundation/ServerStateProvider/ServerStateProvider.js +27 -22
  43. package/dist/node/foundation/ShopifyProvider/types.d.ts +3 -1
  44. package/dist/node/framework/Hydration/ServerComponentRequest.server.d.ts +7 -0
  45. package/dist/node/framework/Hydration/ServerComponentRequest.server.js +24 -7
  46. package/dist/node/framework/cache/in-memory.d.ts +1 -0
  47. package/dist/node/framework/cache/in-memory.js +15 -5
  48. package/dist/node/framework/cache.d.ts +0 -8
  49. package/dist/node/framework/cache.js +1 -10
  50. package/dist/node/storefront-api-types.d.ts +150 -3
  51. package/dist/node/storefront-api-types.js +17 -1
  52. package/dist/node/utilities/apiRoutes.js +3 -1
  53. package/dist/node/version.d.ts +1 -1
  54. package/dist/node/version.js +1 -1
  55. package/package.json +3 -3
  56. package/dist/esnext/components/LocalizationProvider/LocalizationQuery.d.ts +0 -23
  57. package/dist/esnext/components/LocalizationProvider/LocalizationQuery.js +0 -1
@@ -25,13 +25,7 @@ export class ServerComponentRequest extends Request {
25
25
  super(input, init);
26
26
  }
27
27
  else {
28
- super(getUrlFromNodeRequest(input), {
29
- headers: new Headers(input.headers),
30
- method: input.method,
31
- body: input.method !== 'GET' && input.method !== 'HEAD'
32
- ? input.body
33
- : undefined,
34
- });
28
+ super(getUrlFromNodeRequest(input), getInitFromNodeRequest(input));
35
29
  }
36
30
  this.time = getTime();
37
31
  this.id = generateId();
@@ -85,6 +79,15 @@ export class ServerComponentRequest extends Request {
85
79
  savePreloadQueries() {
86
80
  preloadCache.set(this.preloadURL, this.ctx.preloadQueries);
87
81
  }
82
+ /**
83
+ * Buyer IP varies by hosting provider and runtime. The developer should provide this
84
+ * as an argument to the `handleRequest` function for their runtime.
85
+ * Defaults to `x-forwarded-for` header value.
86
+ */
87
+ getBuyerIp() {
88
+ var _a;
89
+ return this.headers.get((_a = this.ctx.buyerIpHeader) !== null && _a !== void 0 ? _a : 'x-forwarded-for');
90
+ }
88
91
  }
89
92
  function mergeMapEntries(map1, map2) {
90
93
  map2 && map2.forEach((v, k) => map1.set(k, v));
@@ -112,3 +115,17 @@ function getUrlFromNodeRequest(request) {
112
115
  const secure = request.headers['x-forwarded-proto'] === 'https';
113
116
  return new URL(`${secure ? 'https' : 'http'}://${request.headers.host + url}`).toString();
114
117
  }
118
+ function getInitFromNodeRequest(request) {
119
+ const init = {
120
+ headers: new Headers(request.headers),
121
+ method: request.method,
122
+ body: request.method !== 'GET' && request.method !== 'HEAD'
123
+ ? request.body
124
+ : undefined,
125
+ };
126
+ const remoteAddress = request.socket.remoteAddress;
127
+ if (!init.headers.has('x-forwarded-for') && remoteAddress) {
128
+ init.headers.set('x-forwarded-for', remoteAddress);
129
+ }
130
+ return init;
131
+ }
@@ -8,4 +8,5 @@ export declare class InMemoryCache {
8
8
  put(request: Request, response: Response): void;
9
9
  match(request: Request): Response | undefined;
10
10
  delete(request: Request): void;
11
+ keys(request?: Request): Promise<Request[]>;
11
12
  }
@@ -15,16 +15,17 @@ export class InMemoryCache {
15
15
  });
16
16
  }
17
17
  match(request) {
18
+ var _a, _b;
18
19
  const match = this.store.get(request.url);
19
20
  if (!match) {
20
21
  logCacheApiStatus('MISS', request.url);
21
22
  return;
22
23
  }
23
24
  const { value, date } = match;
24
- const cacheControl = value.headers.get('cache-control');
25
- const maxAge = parseInt(cacheControl.match(/max-age=(\d+)/)[1], 10);
26
- const swr = parseInt(cacheControl.match(/stale-while-revalidate=(\d+)/)[1], 10);
27
- const age = (new Date().valueOf() - date) / 1000;
25
+ const cacheControl = value.headers.get('cache-control') || '';
26
+ const maxAge = parseInt(((_a = cacheControl.match(/max-age=(\d+)/)) === null || _a === void 0 ? void 0 : _a[1]) || '0', 10);
27
+ const swr = parseInt(((_b = cacheControl.match(/stale-while-revalidate=(\d+)/)) === null || _b === void 0 ? void 0 : _b[1]) || '0', 10);
28
+ const age = (new Date().valueOf() - date.valueOf()) / 1000;
28
29
  const isMiss = age > maxAge + swr;
29
30
  if (isMiss) {
30
31
  logCacheApiStatus('MISS', request.url);
@@ -34,7 +35,7 @@ export class InMemoryCache {
34
35
  const isStale = age > maxAge;
35
36
  const headers = new Headers(value.headers);
36
37
  headers.set('cache', isStale ? 'STALE' : 'HIT');
37
- headers.set('date', date.toGMTString());
38
+ headers.set('date', date.toUTCString());
38
39
  logCacheApiStatus(headers.get('cache'), request.url);
39
40
  const response = new Response(value.body, {
40
41
  headers,
@@ -45,4 +46,13 @@ export class InMemoryCache {
45
46
  this.store.delete(request.url);
46
47
  logCacheApiStatus('DELETE', request.url);
47
48
  }
49
+ keys(request) {
50
+ const cacheKeys = [];
51
+ for (const url of this.store.keys()) {
52
+ if (!request || request.url === url) {
53
+ cacheKeys.push(new Request(url));
54
+ }
55
+ }
56
+ return Promise.resolve(cacheKeys);
57
+ }
48
58
  }
@@ -1,13 +1,5 @@
1
1
  import type { QueryKey, CachingStrategy } from '../types';
2
2
  export declare function generateSubRequestCacheControlHeader(userCacheOptions?: CachingStrategy): string;
3
- /**
4
- * Use a preview header during development.
5
- * TODO: Support an override of this to force the cache
6
- * header to be present during dev. ENV var maybe?
7
- */
8
- export declare function getCacheControlHeader({ dev }: {
9
- dev?: boolean;
10
- }): "cache-control-preview" | "cache-control";
11
3
  export declare function hashKey(key: QueryKey): string;
12
4
  /**
13
5
  * Get an item from the cache. If a match is found, returns a tuple
@@ -3,14 +3,6 @@ import { CacheSeconds, generateCacheControlHeader, } from '../framework/CachingS
3
3
  export function generateSubRequestCacheControlHeader(userCacheOptions) {
4
4
  return generateCacheControlHeader(userCacheOptions || CacheSeconds());
5
5
  }
6
- /**
7
- * Use a preview header during development.
8
- * TODO: Support an override of this to force the cache
9
- * header to be present during dev. ENV var maybe?
10
- */
11
- export function getCacheControlHeader({ dev }) {
12
- return dev ? 'cache-control-preview' : 'cache-control';
13
- }
14
6
  export function hashKey(key) {
15
7
  const rawKey = key instanceof Array ? key : [key];
16
8
  /**
@@ -15,7 +15,7 @@ metafields?: PartialDeep<MetafieldConnection>): {
15
15
  key?: string | undefined;
16
16
  namespace?: string | undefined;
17
17
  parentResource?: import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").ProductVariant> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Product> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Blog> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Article> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Customer> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Order> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Collection> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Page> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Shop> | undefined;
18
- reference?: import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").MediaImage> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").ProductVariant> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Product> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Page> | null | undefined;
18
+ reference?: import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Video> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").MediaImage> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").ProductVariant> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Product> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").Page> | import("type-fest/source/partial-deep").PartialObjectDeep<import("../../storefront-api-types").GenericFile> | null | undefined;
19
19
  type?: string | undefined;
20
20
  updatedAt?: string | undefined;
21
21
  }[];
@@ -8,7 +8,7 @@ export interface UseShopQueryResponse<T> {
8
8
  /**
9
9
  * The `useShopQuery` hook allows you to make server-only GraphQL queries to the Storefront API. It must be a descendent of a `ShopifyProvider` component.
10
10
  */
11
- export declare function useShopQuery<T>({ query, variables, cache, locale, preload, }: {
11
+ export declare function useShopQuery<T>({ query, variables, cache, preload, }: {
12
12
  /** A string of the GraphQL query.
13
13
  * If no query is provided, useShopQuery will make no calls to the Storefront API.
14
14
  */
@@ -6,22 +6,26 @@ import { getConfig } from '../../framework/config';
6
6
  import { useServerRequest } from '../../foundation/ServerRequestProvider';
7
7
  import { injectGraphQLTracker } from '../../utilities/graphql-tracker';
8
8
  import { sendMessageToClient } from '../../utilities/devtools';
9
+ import { META_ENV_SSR } from '../../foundation/ssr-interop';
10
+ // Check if the response body has GraphQL errors
11
+ // https://spec.graphql.org/June2018/#sec-Response-Format
12
+ const shouldCacheResponse = (body) => !(body === null || body === void 0 ? void 0 : body.errors);
9
13
  /**
10
14
  * The `useShopQuery` hook allows you to make server-only GraphQL queries to the Storefront API. It must be a descendent of a `ShopifyProvider` component.
11
15
  */
12
- export function useShopQuery({ query, variables = {}, cache, locale = '', preload = false, }) {
16
+ export function useShopQuery({ query, variables = {}, cache, preload = false, }) {
13
17
  var _a;
14
- if (!import.meta.env.SSR) {
18
+ if (!META_ENV_SSR) {
15
19
  throw new Error('Shopify Storefront API requests should only be made from the server.');
16
20
  }
17
21
  const serverRequest = useServerRequest();
18
22
  const log = getLoggerWithContext(serverRequest);
19
23
  const body = query ? graphqlRequestBody(query, variables) : '';
20
- const { key, url, requestInit } = createShopRequest(body, locale);
24
+ const { key, url, requestInit } = useCreateShopRequest(body);
21
25
  const { data, error: useQueryError } = useQuery(key, query
22
26
  ? fetchBuilder(url, requestInit)
23
27
  : // If no query, avoid calling SFAPI & return nothing
24
- async () => ({ data: undefined, errors: undefined }), { cache, preload });
28
+ async () => ({ data: undefined, errors: undefined }), { cache, shouldCacheResponse, preload });
25
29
  /**
26
30
  * The fetch request itself failed, so we handle that differently than a GraphQL error
27
31
  */
@@ -42,7 +46,7 @@ export function useShopQuery({ query, variables = {}, cache, locale = '', preloa
42
46
  * get returned to the consumer.
43
47
  */
44
48
  if (data === null || data === void 0 ? void 0 : data.errors) {
45
- const errors = data.errors instanceof Array ? data.errors : [data.errors];
49
+ const errors = Array.isArray(data.errors) ? data.errors : [data.errors];
46
50
  for (const error of errors) {
47
51
  if (getConfig().dev) {
48
52
  throw new Error(error.message);
@@ -53,7 +57,7 @@ export function useShopQuery({ query, variables = {}, cache, locale = '', preloa
53
57
  }
54
58
  log.error(`GraphQL errors: ${errors.length}`);
55
59
  }
56
- if (import.meta.env.DEV &&
60
+ if (__DEV__ &&
57
61
  log.options().showUnusedQueryProperties &&
58
62
  query &&
59
63
  typeof query !== 'string' &&
@@ -90,28 +94,45 @@ export function useShopQuery({ query, variables = {}, cache, locale = '', preloa
90
94
  }
91
95
  return data;
92
96
  }
93
- function createShopRequest(body, locale) {
97
+ function useCreateShopRequest(body) {
94
98
  var _a;
95
- const { storeDomain, storefrontToken, storefrontApiVersion, locale: defaultLocale, } = useShop();
99
+ const { storeDomain, storefrontToken, storefrontApiVersion } = useShop();
100
+ const request = useServerRequest();
101
+ const secretToken = typeof Oxygen !== 'undefined'
102
+ ? (_a = Oxygen === null || Oxygen === void 0 ? void 0 : Oxygen.env) === null || _a === void 0 ? void 0 : _a.SHOPIFY_STOREFRONT_API_SECRET_TOKEN
103
+ : null;
104
+ const buyerIp = request.getBuyerIp();
105
+ const extraHeaders = {};
106
+ /**
107
+ * Only pass one type of storefront token at a time.
108
+ */
109
+ if (secretToken) {
110
+ extraHeaders['Shopify-Storefront-Private-Token'] = secretToken;
111
+ }
112
+ else {
113
+ extraHeaders['X-Shopify-Storefront-Access-Token'] = storefrontToken;
114
+ }
115
+ if (buyerIp) {
116
+ extraHeaders['Shopify-Storefront-Buyer-IP'] = buyerIp;
117
+ }
96
118
  return {
97
- key: [storeDomain, storefrontApiVersion, body, locale],
119
+ key: [storeDomain, storefrontApiVersion, body],
98
120
  url: `https://${storeDomain}/api/${storefrontApiVersion}/graphql.json`,
99
121
  requestInit: {
100
122
  body,
101
123
  method: 'POST',
102
124
  headers: {
103
- 'X-Shopify-Storefront-Access-Token': storefrontToken,
104
125
  'X-SDK-Variant': 'hydrogen',
105
126
  'X-SDK-Version': storefrontApiVersion,
106
127
  'content-type': 'application/json',
107
- 'Accept-Language': (_a = locale) !== null && _a !== void 0 ? _a : defaultLocale,
128
+ ...extraHeaders,
108
129
  },
109
130
  },
110
131
  };
111
132
  }
112
133
  function createErrorMessage(fetchError) {
113
134
  if (fetchError instanceof Response) {
114
- `An error occurred while fetching from the Storefront API. ${
135
+ return `An error occurred while fetching from the Storefront API. ${
115
136
  // 403s to the SF API (almost?) always mean that your Shopify credentials are bad/wrong
116
137
  fetchError.status === 403
117
138
  ? `You may have a bad value in 'shopify.config.js'`
@@ -1,10 +1,9 @@
1
1
  import '../utilities/web-api-polyfill';
2
2
  import connect from 'connect';
3
3
  declare type CreateServerOptions = {
4
- port?: number | string;
4
+ cache?: Cache;
5
5
  };
6
- export declare function createServer({ port, }?: CreateServerOptions): Promise<{
6
+ export declare function createServer({ cache }?: CreateServerOptions): Promise<{
7
7
  app: connect.Server;
8
- port: string | number;
9
8
  }>;
10
9
  export {};
@@ -14,7 +14,7 @@ import compression from 'compression';
14
14
  import bodyParser from 'body-parser';
15
15
  import connect from 'connect';
16
16
  const handleRequest = entrypoint;
17
- export async function createServer({ port = process.env.PORT || 8080, } = {}) {
17
+ export async function createServer({ cache } = {}) {
18
18
  // @ts-ignore
19
19
  globalThis.Oxygen = { env: process.env };
20
20
  const app = connect();
@@ -26,11 +26,13 @@ export async function createServer({ port = process.env.PORT || 8080, } = {}) {
26
26
  app.use(hydrogenMiddleware({
27
27
  getServerEntrypoint: () => handleRequest,
28
28
  indexTemplate,
29
+ cache,
29
30
  }));
30
- return { app, port };
31
+ return { app };
31
32
  }
32
33
  if (require.main === module) {
33
- createServer().then(({ app, port }) => {
34
+ createServer().then(({ app }) => {
35
+ const port = process.env.PORT || 8080;
34
36
  app.listen(port, () => {
35
37
  console.log(`Hydrogen server running at http://localhost:${port}`);
36
38
  });
@@ -13,8 +13,9 @@ export default {
13
13
  try {
14
14
  return (await handleRequest(request, {
15
15
  indexTemplate,
16
- cache: caches.default,
16
+ cache: await caches.open('oxygen'),
17
17
  context,
18
+ buyerIpHeader: 'oxygen-buyer-ip',
18
19
  }));
19
20
  }
20
21
  catch (error) {
@@ -215,6 +215,8 @@ export declare type ArticleConnection = {
215
215
  __typename?: 'ArticleConnection';
216
216
  /** A list of edges. */
217
217
  edges: Array<ArticleEdge>;
218
+ /** A list of the nodes contained in ArticleEdge. */
219
+ nodes: Array<Article>;
218
220
  /** Information to aid in pagination. */
219
221
  pageInfo: PageInfo;
220
222
  };
@@ -362,6 +364,8 @@ export declare type BlogConnection = {
362
364
  __typename?: 'BlogConnection';
363
365
  /** A list of edges. */
364
366
  edges: Array<BlogEdge>;
367
+ /** A list of the nodes contained in BlogEdge. */
368
+ nodes: Array<Blog>;
365
369
  /** Information to aid in pagination. */
366
370
  pageInfo: PageInfo;
367
371
  };
@@ -417,6 +421,8 @@ export declare type Cart = Node & {
417
421
  checkoutUrl: Scalars['URL'];
418
422
  /** The date and time when the cart was created. */
419
423
  createdAt: Scalars['DateTime'];
424
+ /** The delivery groups available for the cart, based on the default address of the logged-in customer. */
425
+ deliveryGroups: CartDeliveryGroupConnection;
420
426
  /** The discount codes that have been applied to the cart. */
421
427
  discountCodes: Array<CartDiscountCode>;
422
428
  /** The estimated costs that the buyer will pay at checkout. The estimated costs are subject to change and changes will be reflected at checkout. The `estimatedCost` field uses the `buyerIdentity` field to determine [international pricing](https://shopify.dev/api/examples/international-pricing#create-a-cart). */
@@ -431,6 +437,14 @@ export declare type Cart = Node & {
431
437
  updatedAt: Scalars['DateTime'];
432
438
  };
433
439
  /** A cart represents the merchandise that a buyer intends to purchase, and the estimated cost associated with the cart. To learn how to interact with a cart during a customer's session, refer to [Manage a cart with the Storefront API](https://shopify.dev/api/examples/cart). */
440
+ export declare type CartDeliveryGroupsArgs = {
441
+ after?: InputMaybe<Scalars['String']>;
442
+ before?: InputMaybe<Scalars['String']>;
443
+ first?: InputMaybe<Scalars['Int']>;
444
+ last?: InputMaybe<Scalars['Int']>;
445
+ reverse?: InputMaybe<Scalars['Boolean']>;
446
+ };
447
+ /** A cart represents the merchandise that a buyer intends to purchase, and the estimated cost associated with the cart. To learn how to interact with a cart during a customer's session, refer to [Manage a cart with the Storefront API](https://shopify.dev/api/examples/cart). */
434
448
  export declare type CartLinesArgs = {
435
449
  after?: InputMaybe<Scalars['String']>;
436
450
  before?: InputMaybe<Scalars['String']>;
@@ -507,6 +521,64 @@ export declare type CartCreatePayload = {
507
521
  /** The list of errors that occurred from executing the mutation. */
508
522
  userErrors: Array<CartUserError>;
509
523
  };
524
+ /** Information about the options available for one or more line items to be delivered to a specific address. */
525
+ export declare type CartDeliveryGroup = {
526
+ __typename?: 'CartDeliveryGroup';
527
+ /** A list of cart lines for the delivery group. */
528
+ cartLines: CartLineConnection;
529
+ /** The destination address for the delivery group. */
530
+ deliveryAddress: MailingAddress;
531
+ /** The delivery options available for the delivery group. */
532
+ deliveryOptions: Array<CartDeliveryOption>;
533
+ /** The ID for the delivery group. */
534
+ id: Scalars['ID'];
535
+ };
536
+ /** Information about the options available for one or more line items to be delivered to a specific address. */
537
+ export declare type CartDeliveryGroupCartLinesArgs = {
538
+ after?: InputMaybe<Scalars['String']>;
539
+ before?: InputMaybe<Scalars['String']>;
540
+ first?: InputMaybe<Scalars['Int']>;
541
+ last?: InputMaybe<Scalars['Int']>;
542
+ reverse?: InputMaybe<Scalars['Boolean']>;
543
+ };
544
+ /**
545
+ * An auto-generated type for paginating through multiple CartDeliveryGroups.
546
+ *
547
+ */
548
+ export declare type CartDeliveryGroupConnection = {
549
+ __typename?: 'CartDeliveryGroupConnection';
550
+ /** A list of edges. */
551
+ edges: Array<CartDeliveryGroupEdge>;
552
+ /** A list of the nodes contained in CartDeliveryGroupEdge. */
553
+ nodes: Array<CartDeliveryGroup>;
554
+ /** Information to aid in pagination. */
555
+ pageInfo: PageInfo;
556
+ };
557
+ /**
558
+ * An auto-generated type which holds one CartDeliveryGroup and a cursor during pagination.
559
+ *
560
+ */
561
+ export declare type CartDeliveryGroupEdge = {
562
+ __typename?: 'CartDeliveryGroupEdge';
563
+ /** A cursor for use in pagination. */
564
+ cursor: Scalars['String'];
565
+ /** The item at the end of CartDeliveryGroupEdge. */
566
+ node: CartDeliveryGroup;
567
+ };
568
+ /** Information about a delivery option. */
569
+ export declare type CartDeliveryOption = {
570
+ __typename?: 'CartDeliveryOption';
571
+ /** The code of the delivery option. */
572
+ code?: Maybe<Scalars['String']>;
573
+ /** The method for the delivery option. */
574
+ deliveryMethodType: DeliveryMethodType;
575
+ /** The description of the delivery option. */
576
+ description?: Maybe<Scalars['String']>;
577
+ /** The estimated cost for the delivery option. */
578
+ estimatedCost: MoneyV2;
579
+ /** The title of the delivery option. */
580
+ title?: Maybe<Scalars['String']>;
581
+ };
510
582
  /** The discounts that have been applied to the cart line. */
511
583
  export declare type CartDiscountAllocation = {
512
584
  /** The discounted amount that has been applied to the cart line. */
@@ -597,6 +669,8 @@ export declare type CartLineConnection = {
597
669
  __typename?: 'CartLineConnection';
598
670
  /** A list of edges. */
599
671
  edges: Array<CartLineEdge>;
672
+ /** A list of the nodes contained in CartLineEdge. */
673
+ nodes: Array<CartLine>;
600
674
  /** Information to aid in pagination. */
601
675
  pageInfo: PageInfo;
602
676
  };
@@ -1282,6 +1356,8 @@ export declare type CheckoutLineItemConnection = {
1282
1356
  __typename?: 'CheckoutLineItemConnection';
1283
1357
  /** A list of edges. */
1284
1358
  edges: Array<CheckoutLineItemEdge>;
1359
+ /** A list of the nodes contained in CheckoutLineItemEdge. */
1360
+ nodes: Array<CheckoutLineItem>;
1285
1361
  /** Information to aid in pagination. */
1286
1362
  pageInfo: PageInfo;
1287
1363
  };
@@ -1484,6 +1560,8 @@ export declare type CollectionConnection = {
1484
1560
  __typename?: 'CollectionConnection';
1485
1561
  /** A list of edges. */
1486
1562
  edges: Array<CollectionEdge>;
1563
+ /** A list of the nodes contained in CollectionEdge. */
1564
+ nodes: Array<Collection>;
1487
1565
  /** Information to aid in pagination. */
1488
1566
  pageInfo: PageInfo;
1489
1567
  };
@@ -1545,6 +1623,8 @@ export declare type CommentConnection = {
1545
1623
  __typename?: 'CommentConnection';
1546
1624
  /** A list of edges. */
1547
1625
  edges: Array<CommentEdge>;
1626
+ /** A list of the nodes contained in CommentEdge. */
1627
+ nodes: Array<Comment>;
1548
1628
  /** Information to aid in pagination. */
1549
1629
  pageInfo: PageInfo;
1550
1630
  };
@@ -2845,6 +2925,21 @@ export declare type CustomerUserError = DisplayableError & {
2845
2925
  /** The error message. */
2846
2926
  message: Scalars['String'];
2847
2927
  };
2928
+ /** List of different delivery method types. */
2929
+ export declare enum DeliveryMethodType {
2930
+ /** Local Delivery. */
2931
+ Local = "LOCAL",
2932
+ /** None. */
2933
+ None = "NONE",
2934
+ /** Shipping to a Pickup Point. */
2935
+ PickupPoint = "PICKUP_POINT",
2936
+ /** Local Pickup. */
2937
+ PickUp = "PICK_UP",
2938
+ /** Retail. */
2939
+ Retail = "RETAIL",
2940
+ /** Shipping. */
2941
+ Shipping = "SHIPPING"
2942
+ }
2848
2943
  /** Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. */
2849
2944
  export declare enum DigitalWallet {
2850
2945
  /** Android Pay. */
@@ -2899,6 +2994,8 @@ export declare type DiscountApplicationConnection = {
2899
2994
  __typename?: 'DiscountApplicationConnection';
2900
2995
  /** A list of edges. */
2901
2996
  edges: Array<DiscountApplicationEdge>;
2997
+ /** A list of the nodes contained in DiscountApplicationEdge. */
2998
+ nodes: Array<AutomaticDiscountApplication | DiscountCodeApplication | ManualDiscountApplication | ScriptDiscountApplication>;
2902
2999
  /** Information to aid in pagination. */
2903
3000
  pageInfo: PageInfo;
2904
3001
  };
@@ -3076,6 +3173,8 @@ export declare type FulfillmentLineItemConnection = {
3076
3173
  __typename?: 'FulfillmentLineItemConnection';
3077
3174
  /** A list of edges. */
3078
3175
  edges: Array<FulfillmentLineItemEdge>;
3176
+ /** A list of the nodes contained in FulfillmentLineItemEdge. */
3177
+ nodes: Array<FulfillmentLineItem>;
3079
3178
  /** Information to aid in pagination. */
3080
3179
  pageInfo: PageInfo;
3081
3180
  };
@@ -3098,6 +3197,22 @@ export declare type FulfillmentTrackingInfo = {
3098
3197
  /** The URL to track the fulfillment. */
3099
3198
  url?: Maybe<Scalars['URL']>;
3100
3199
  };
3200
+ /** The generic file resource lets you manage files in a merchant’s store. Generic files include any file that doesn’t fit into a designated type such as image or video. Example: PDF, JSON. */
3201
+ export declare type GenericFile = Node & {
3202
+ __typename?: 'GenericFile';
3203
+ /** A word or phrase to indicate the contents of a file. */
3204
+ alt?: Maybe<Scalars['String']>;
3205
+ /** A globally-unique identifier. */
3206
+ id: Scalars['ID'];
3207
+ /** The mime type of the file. */
3208
+ mimeType?: Maybe<Scalars['String']>;
3209
+ /** The size of the original file in bytes. */
3210
+ originalFileSize?: Maybe<Scalars['Int']>;
3211
+ /** The preview image for the file. */
3212
+ previewImage?: Maybe<Image>;
3213
+ /** The URL of the file. */
3214
+ url?: Maybe<Scalars['URL']>;
3215
+ };
3101
3216
  /** Used to specify a geographical location. */
3102
3217
  export declare type GeoCoordinateInput = {
3103
3218
  /** The coordinate's latitude value. */
@@ -3195,6 +3310,8 @@ export declare type ImageConnection = {
3195
3310
  __typename?: 'ImageConnection';
3196
3311
  /** A list of edges. */
3197
3312
  edges: Array<ImageEdge>;
3313
+ /** A list of the nodes contained in ImageEdge. */
3314
+ nodes: Array<Image>;
3198
3315
  /** Information to aid in pagination. */
3199
3316
  pageInfo: PageInfo;
3200
3317
  };
@@ -3600,6 +3717,8 @@ export declare type LocationConnection = {
3600
3717
  __typename?: 'LocationConnection';
3601
3718
  /** A list of edges. */
3602
3719
  edges: Array<LocationEdge>;
3720
+ /** A list of the nodes contained in LocationEdge. */
3721
+ nodes: Array<Location>;
3603
3722
  /** Information to aid in pagination. */
3604
3723
  pageInfo: PageInfo;
3605
3724
  };
@@ -3716,6 +3835,8 @@ export declare type MailingAddressConnection = {
3716
3835
  __typename?: 'MailingAddressConnection';
3717
3836
  /** A list of edges. */
3718
3837
  edges: Array<MailingAddressEdge>;
3838
+ /** A list of the nodes contained in MailingAddressEdge. */
3839
+ nodes: Array<MailingAddress>;
3719
3840
  /** Information to aid in pagination. */
3720
3841
  pageInfo: PageInfo;
3721
3842
  };
@@ -3806,6 +3927,8 @@ export declare type MediaConnection = {
3806
3927
  __typename?: 'MediaConnection';
3807
3928
  /** A list of edges. */
3808
3929
  edges: Array<MediaEdge>;
3930
+ /** A list of the nodes contained in MediaEdge. */
3931
+ nodes: Array<ExternalVideo | MediaImage | Model3d | Video>;
3809
3932
  /** Information to aid in pagination. */
3810
3933
  pageInfo: PageInfo;
3811
3934
  };
@@ -3957,6 +4080,8 @@ export declare type MetafieldConnection = {
3957
4080
  __typename?: 'MetafieldConnection';
3958
4081
  /** A list of edges. */
3959
4082
  edges: Array<MetafieldEdge>;
4083
+ /** A list of the nodes contained in MetafieldEdge. */
4084
+ nodes: Array<Metafield>;
3960
4085
  /** Information to aid in pagination. */
3961
4086
  pageInfo: PageInfo;
3962
4087
  };
@@ -3995,7 +4120,7 @@ export declare type MetafieldParentResource = Article | Blog | Collection | Cust
3995
4120
  * Returns the resource which is being referred to by a metafield.
3996
4121
  *
3997
4122
  */
3998
- export declare type MetafieldReference = MediaImage | Page | Product | ProductVariant;
4123
+ export declare type MetafieldReference = GenericFile | MediaImage | Page | Product | ProductVariant | Video;
3999
4124
  /** Represents a Shopify hosted 3D model. */
4000
4125
  export declare type Model3d = Media & Node & {
4001
4126
  __typename?: 'Model3d';
@@ -4634,6 +4759,8 @@ export declare type OrderConnection = {
4634
4759
  __typename?: 'OrderConnection';
4635
4760
  /** A list of edges. */
4636
4761
  edges: Array<OrderEdge>;
4762
+ /** A list of the nodes contained in OrderEdge. */
4763
+ nodes: Array<Order>;
4637
4764
  /** Information to aid in pagination. */
4638
4765
  pageInfo: PageInfo;
4639
4766
  };
@@ -4714,6 +4841,8 @@ export declare type OrderLineItemConnection = {
4714
4841
  __typename?: 'OrderLineItemConnection';
4715
4842
  /** A list of edges. */
4716
4843
  edges: Array<OrderLineItemEdge>;
4844
+ /** A list of the nodes contained in OrderLineItemEdge. */
4845
+ nodes: Array<OrderLineItem>;
4717
4846
  /** Information to aid in pagination. */
4718
4847
  pageInfo: PageInfo;
4719
4848
  };
@@ -4795,6 +4924,8 @@ export declare type PageConnection = {
4795
4924
  __typename?: 'PageConnection';
4796
4925
  /** A list of edges. */
4797
4926
  edges: Array<PageEdge>;
4927
+ /** A list of the nodes contained in PageEdge. */
4928
+ nodes: Array<Page>;
4798
4929
  /** Information to aid in pagination. */
4799
4930
  pageInfo: PageInfo;
4800
4931
  };
@@ -4816,10 +4947,14 @@ export declare type PageEdge = {
4816
4947
  */
4817
4948
  export declare type PageInfo = {
4818
4949
  __typename?: 'PageInfo';
4950
+ /** The cursor corresponding to the last node in edges. */
4951
+ endCursor?: Maybe<Scalars['String']>;
4819
4952
  /** Whether there are more pages to fetch following the current page. */
4820
4953
  hasNextPage: Scalars['Boolean'];
4821
4954
  /** Whether there are any pages prior to the current page. */
4822
4955
  hasPreviousPage: Scalars['Boolean'];
4956
+ /** The cursor corresponding to the first node in edges. */
4957
+ startCursor?: Maybe<Scalars['String']>;
4823
4958
  };
4824
4959
  /** The set of valid sort keys for the Page query. */
4825
4960
  export declare enum PageSortKeys {
@@ -5141,6 +5276,8 @@ export declare type ProductConnection = {
5141
5276
  edges: Array<ProductEdge>;
5142
5277
  /** A list of available filters. */
5143
5278
  filters: Array<Filter>;
5279
+ /** A list of the nodes contained in ProductEdge. */
5280
+ nodes: Array<Product>;
5144
5281
  /** Information to aid in pagination. */
5145
5282
  pageInfo: PageInfo;
5146
5283
  };
@@ -5349,6 +5486,8 @@ export declare type ProductVariantConnection = {
5349
5486
  __typename?: 'ProductVariantConnection';
5350
5487
  /** A list of edges. */
5351
5488
  edges: Array<ProductVariantEdge>;
5489
+ /** A list of the nodes contained in ProductVariantEdge. */
5490
+ nodes: Array<ProductVariant>;
5352
5491
  /** Information to aid in pagination. */
5353
5492
  pageInfo: PageInfo;
5354
5493
  };
@@ -5419,9 +5558,9 @@ export declare type QueryRoot = {
5419
5558
  /** A storefront menu. */
5420
5559
  menu?: Maybe<Menu>;
5421
5560
  /** Returns a specific node by ID. */
5422
- node?: Maybe<AppliedGiftCard | Article | Blog | Cart | CartLine | Checkout | CheckoutLineItem | Collection | Comment | ExternalVideo | Location | MailingAddress | MediaImage | Menu | MenuItem | Metafield | Model3d | Order | Page | Payment | Product | ProductOption | ProductVariant | Shop | ShopPolicy | Video>;
5561
+ node?: Maybe<AppliedGiftCard | Article | Blog | Cart | CartLine | Checkout | CheckoutLineItem | Collection | Comment | ExternalVideo | GenericFile | Location | MailingAddress | MediaImage | Menu | MenuItem | Metafield | Model3d | Order | Page | Payment | Product | ProductOption | ProductVariant | Shop | ShopPolicy | Video>;
5423
5562
  /** Returns the list of nodes with the given IDs. */
5424
- nodes: Array<Maybe<AppliedGiftCard | Article | Blog | Cart | CartLine | Checkout | CheckoutLineItem | Collection | Comment | ExternalVideo | Location | MailingAddress | MediaImage | Menu | MenuItem | Metafield | Model3d | Order | Page | Payment | Product | ProductOption | ProductVariant | Shop | ShopPolicy | Video>>;
5563
+ nodes: Array<Maybe<AppliedGiftCard | Article | Blog | Cart | CartLine | Checkout | CheckoutLineItem | Collection | Comment | ExternalVideo | GenericFile | Location | MailingAddress | MediaImage | Menu | MenuItem | Metafield | Model3d | Order | Page | Payment | Product | ProductOption | ProductVariant | Shop | ShopPolicy | Video>>;
5425
5564
  /** Fetch a specific `Page` by one of its unique attributes. */
5426
5565
  page?: Maybe<Page>;
5427
5566
  /**
@@ -5665,6 +5804,8 @@ export declare type SellingPlanAllocationConnection = {
5665
5804
  __typename?: 'SellingPlanAllocationConnection';
5666
5805
  /** A list of edges. */
5667
5806
  edges: Array<SellingPlanAllocationEdge>;
5807
+ /** A list of the nodes contained in SellingPlanAllocationEdge. */
5808
+ nodes: Array<SellingPlanAllocation>;
5668
5809
  /** Information to aid in pagination. */
5669
5810
  pageInfo: PageInfo;
5670
5811
  };
@@ -5699,6 +5840,8 @@ export declare type SellingPlanConnection = {
5699
5840
  __typename?: 'SellingPlanConnection';
5700
5841
  /** A list of edges. */
5701
5842
  edges: Array<SellingPlanEdge>;
5843
+ /** A list of the nodes contained in SellingPlanEdge. */
5844
+ nodes: Array<SellingPlan>;
5702
5845
  /** Information to aid in pagination. */
5703
5846
  pageInfo: PageInfo;
5704
5847
  };
@@ -5753,6 +5896,8 @@ export declare type SellingPlanGroupConnection = {
5753
5896
  __typename?: 'SellingPlanGroupConnection';
5754
5897
  /** A list of edges. */
5755
5898
  edges: Array<SellingPlanGroupEdge>;
5899
+ /** A list of the nodes contained in SellingPlanGroupEdge. */
5900
+ nodes: Array<SellingPlanGroup>;
5756
5901
  /** Information to aid in pagination. */
5757
5902
  pageInfo: PageInfo;
5758
5903
  };
@@ -5919,6 +6064,8 @@ export declare type StoreAvailabilityConnection = {
5919
6064
  __typename?: 'StoreAvailabilityConnection';
5920
6065
  /** A list of edges. */
5921
6066
  edges: Array<StoreAvailabilityEdge>;
6067
+ /** A list of the nodes contained in StoreAvailabilityEdge. */
6068
+ nodes: Array<StoreAvailability>;
5922
6069
  /** Information to aid in pagination. */
5923
6070
  pageInfo: PageInfo;
5924
6071
  };