@vendure/dashboard 3.3.6-master-202507010243 → 3.3.6-master-202507010731
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/package.json +4 -4
- package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +7 -2
- package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_countries/countries.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +9 -5
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +8 -5
- package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +5 -2
- package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_products/products_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +6 -2
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +5 -1
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +9 -5
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +8 -4
- package/src/app/routes/_authenticated/_zones/zones.graphql.ts +1 -1
- package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +8 -4
- package/src/lib/framework/document-extension/extend-detail-form-query.ts +50 -0
- package/src/lib/framework/document-extension/extend-document.spec.ts +335 -0
- package/src/lib/framework/document-introspection/add-custom-fields.ts +48 -0
- package/src/lib/framework/extension-api/define-dashboard-extension.ts +19 -1
- package/src/lib/framework/extension-api/extension-api-types.ts +15 -2
- package/src/lib/framework/form-engine/custom-form-component-extensions.ts +13 -3
- package/src/lib/framework/layout-engine/page-layout.tsx +1 -0
- package/src/lib/framework/page/detail-page-route-loader.tsx +13 -1
- package/src/lib/framework/page/use-detail-page.ts +11 -2
- package/src/lib/framework/registry/registry-types.ts +1 -0
- package/src/lib/graphql/graphql-env.d.ts +8 -6
- package/src/lib/hooks/use-extended-detail-query.ts +37 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NEW_ENTITY_PATH } from '@/constants.js';
|
|
2
2
|
|
|
3
3
|
import { PageBreadcrumb } from '@/components/layout/generated-breadcrumbs.js';
|
|
4
|
+
import { extendDetailFormQuery } from '@/framework/document-extension/extend-detail-form-query.js';
|
|
4
5
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
5
6
|
import { FileBaseRouteOptions, ParsedLocation } from '@tanstack/react-router';
|
|
6
7
|
import { addCustomFields } from '../document-introspection/add-custom-fields.js';
|
|
@@ -9,6 +10,12 @@ import { DetailEntity } from './page-types.js';
|
|
|
9
10
|
import { getDetailQueryOptions } from './use-detail-page.js';
|
|
10
11
|
|
|
11
12
|
export interface DetailPageRouteLoaderConfig<T extends TypedDocumentNode<any, any>> {
|
|
13
|
+
/**
|
|
14
|
+
* @description
|
|
15
|
+
* The pageId is used to ensure any detail form extensions (such as extensions to
|
|
16
|
+
* the detail query document) get correctly applied at the route loader level.
|
|
17
|
+
*/
|
|
18
|
+
pageId?: string;
|
|
12
19
|
queryDocument: T;
|
|
13
20
|
breadcrumb: (
|
|
14
21
|
isNew: boolean,
|
|
@@ -18,6 +25,7 @@ export interface DetailPageRouteLoaderConfig<T extends TypedDocumentNode<any, an
|
|
|
18
25
|
}
|
|
19
26
|
|
|
20
27
|
export function detailPageRouteLoader<T extends TypedDocumentNode<any, any>>({
|
|
28
|
+
pageId,
|
|
21
29
|
queryDocument,
|
|
22
30
|
breadcrumb,
|
|
23
31
|
}: DetailPageRouteLoaderConfig<T>) {
|
|
@@ -34,10 +42,14 @@ export function detailPageRouteLoader<T extends TypedDocumentNode<any, any>>({
|
|
|
34
42
|
throw new Error('ID param is required');
|
|
35
43
|
}
|
|
36
44
|
const isNew = params.id === NEW_ENTITY_PATH;
|
|
45
|
+
const { extendedQuery: extendedQueryDocument } = extendDetailFormQuery(
|
|
46
|
+
addCustomFields(queryDocument),
|
|
47
|
+
pageId,
|
|
48
|
+
);
|
|
37
49
|
const result = isNew
|
|
38
50
|
? null
|
|
39
51
|
: await context.queryClient.ensureQueryData(
|
|
40
|
-
getDetailQueryOptions(
|
|
52
|
+
getDetailQueryOptions(extendedQueryDocument, { id: params.id }),
|
|
41
53
|
{ id: params.id },
|
|
42
54
|
);
|
|
43
55
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NEW_ENTITY_PATH } from '@/constants.js';
|
|
2
2
|
import { api, Variables } from '@/graphql/api.js';
|
|
3
3
|
import { useCustomFieldConfig } from '@/hooks/use-custom-field-config.js';
|
|
4
|
+
import { useExtendedDetailQuery } from '@/hooks/use-extended-detail-query.js';
|
|
4
5
|
import { removeReadonlyCustomFields } from '@/lib/utils.js';
|
|
5
6
|
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
6
7
|
import {
|
|
@@ -48,6 +49,12 @@ export interface DetailPageOptions<
|
|
|
48
49
|
VarNameCreate extends keyof VariablesOf<C> = 'input',
|
|
49
50
|
VarNameUpdate extends keyof VariablesOf<U> = 'input',
|
|
50
51
|
> {
|
|
52
|
+
/**
|
|
53
|
+
* @description
|
|
54
|
+
* The page id. This is optional, but if provided, it will be used to
|
|
55
|
+
* identify the page when extending the detail page query
|
|
56
|
+
*/
|
|
57
|
+
pageId?: string;
|
|
51
58
|
/**
|
|
52
59
|
* @description
|
|
53
60
|
* The query document to fetch the entity.
|
|
@@ -237,6 +244,7 @@ export function useDetailPage<
|
|
|
237
244
|
options: DetailPageOptions<T, C, U, EntityField, VarNameCreate, VarNameUpdate>,
|
|
238
245
|
): UseDetailPageResult<T, C, U, EntityField> {
|
|
239
246
|
const {
|
|
247
|
+
pageId,
|
|
240
248
|
queryDocument,
|
|
241
249
|
createDocument,
|
|
242
250
|
updateDocument,
|
|
@@ -253,11 +261,12 @@ export function useDetailPage<
|
|
|
253
261
|
const queryClient = useQueryClient();
|
|
254
262
|
const returnEntityName = entityName ?? getEntityName(queryDocument);
|
|
255
263
|
const customFieldConfig = useCustomFieldConfig(returnEntityName);
|
|
256
|
-
const
|
|
264
|
+
const extendedDetailQuery = useExtendedDetailQuery(addCustomFields(queryDocument), pageId);
|
|
265
|
+
const detailQueryOptions = getDetailQueryOptions(extendedDetailQuery, {
|
|
257
266
|
id: isNew ? '__NEW__' : params.id,
|
|
258
267
|
});
|
|
259
268
|
const detailQuery = useSuspenseQuery(detailQueryOptions);
|
|
260
|
-
const entityQueryField = entityField ?? getQueryName(
|
|
269
|
+
const entityQueryField = entityField ?? getQueryName(extendedDetailQuery);
|
|
261
270
|
|
|
262
271
|
const entity = (detailQuery?.data as any)[entityQueryField] as
|
|
263
272
|
| DetailPageEntity<T, EntityField>
|
|
@@ -22,4 +22,5 @@ export interface GlobalRegistryContents {
|
|
|
22
22
|
customFormComponents: Map<string, React.FunctionComponent<CustomFormComponentInputProps>>;
|
|
23
23
|
bulkActionsRegistry: Map<string, BulkAction[]>;
|
|
24
24
|
listQueryDocumentRegistry: Map<string, DocumentNode[]>;
|
|
25
|
+
detailQueryDocumentRegistry: Map<string, DocumentNode[]>;
|
|
25
26
|
}
|
|
@@ -280,8 +280,8 @@ export type introspection_types = {
|
|
|
280
280
|
'PreviewCollectionVariantsInput': { kind: 'INPUT_OBJECT'; name: 'PreviewCollectionVariantsInput'; isOneOf: false; inputFields: [{ name: 'parentId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }, { name: 'inheritFilters'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; }; defaultValue: null }, { name: 'filters'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ConfigurableOperationInput'; ofType: null; }; }; }; }; defaultValue: null }]; };
|
|
281
281
|
'PriceRange': { kind: 'OBJECT'; name: 'PriceRange'; fields: { 'max': { name: 'max'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Money'; ofType: null; }; } }; 'min': { name: 'min'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Money'; ofType: null; }; } }; }; };
|
|
282
282
|
'Product': { kind: 'OBJECT'; name: 'Product'; fields: { 'assets': { name: 'assets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Asset'; ofType: null; }; }; }; } }; 'channels': { name: 'channels'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Channel'; ofType: null; }; }; }; } }; 'collections': { name: 'collections'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Collection'; ofType: null; }; }; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'customFields': { name: 'customFields'; type: { kind: 'OBJECT'; name: 'ProductCustomFields'; ofType: null; } }; 'description': { name: 'description'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'enabled': { name: 'enabled'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'facetValues': { name: 'facetValues'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'FacetValue'; ofType: null; }; }; }; } }; 'featuredAsset': { name: 'featuredAsset'; type: { kind: 'OBJECT'; name: 'Asset'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'languageCode': { name: 'languageCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'LanguageCode'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'optionGroups': { name: 'optionGroups'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductOptionGroup'; ofType: null; }; }; }; } }; 'reviews': { name: 'reviews'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductReviewList'; ofType: null; }; } }; 'reviewsHistogram': { name: 'reviewsHistogram'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductReviewHistogramItem'; ofType: null; }; }; }; } }; 'slug': { name: 'slug'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'translations': { name: 'translations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductTranslation'; ofType: null; }; }; }; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'variantList': { name: 'variantList'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductVariantList'; ofType: null; }; } }; 'variants': { name: 'variants'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductVariant'; ofType: null; }; }; }; } }; }; };
|
|
283
|
-
'ProductCustomFields': { kind: 'OBJECT'; name: 'ProductCustomFields'; fields: { 'downloadable': { name: 'downloadable'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'featuredReview': { name: 'featuredReview'; type: { kind: 'OBJECT'; name: 'ProductReview'; ofType: null; } }; 'infoUrl': { name: 'infoUrl'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'lastUpdated': { name: 'lastUpdated'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'reviewCount': { name: 'reviewCount'; type: { kind: 'SCALAR'; name: 'Float'; ofType: null; } }; 'reviewRating': { name: 'reviewRating'; type: { kind: 'SCALAR'; name: 'Float'; ofType: null; } }; 'shortName': { name: 'shortName'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; };
|
|
284
|
-
'ProductFilterParameter': { kind: 'INPUT_OBJECT'; name: 'ProductFilterParameter'; isOneOf: false; inputFields: [{ name: 'facetValueId'; type: { kind: 'INPUT_OBJECT'; name: 'IDOperators'; ofType: null; }; defaultValue: null }, { name: 'sku'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IDOperators'; ofType: null; }; defaultValue: null }, { name: 'createdAt'; type: { kind: 'INPUT_OBJECT'; name: 'DateOperators'; ofType: null; }; defaultValue: null }, { name: 'updatedAt'; type: { kind: 'INPUT_OBJECT'; name: 'DateOperators'; ofType: null; }; defaultValue: null }, { name: 'languageCode'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'slug'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'enabled'; type: { kind: 'INPUT_OBJECT'; name: 'BooleanOperators'; ofType: null; }; defaultValue: null }, { name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductFilterParameter'; ofType: null; }; }; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductFilterParameter'; ofType: null; }; }; }; defaultValue: null }, { name: 'infoUrl'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'downloadable'; type: { kind: 'INPUT_OBJECT'; name: 'BooleanOperators'; ofType: null; }; defaultValue: null }, { name: 'shortName'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'lastUpdated'; type: { kind: 'INPUT_OBJECT'; name: 'DateOperators'; ofType: null; }; defaultValue: null }, { name: 'reviewRating'; type: { kind: 'INPUT_OBJECT'; name: 'NumberOperators'; ofType: null; }; defaultValue: null }, { name: 'reviewCount'; type: { kind: 'INPUT_OBJECT'; name: 'NumberOperators'; ofType: null; }; defaultValue: null }]; };
|
|
283
|
+
'ProductCustomFields': { kind: 'OBJECT'; name: 'ProductCustomFields'; fields: { 'downloadable': { name: 'downloadable'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; } }; 'featuredReview': { name: 'featuredReview'; type: { kind: 'OBJECT'; name: 'ProductReview'; ofType: null; } }; 'infoUrl': { name: 'infoUrl'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'lastUpdated': { name: 'lastUpdated'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; } }; 'reviewCount': { name: 'reviewCount'; type: { kind: 'SCALAR'; name: 'Float'; ofType: null; } }; 'reviewRating': { name: 'reviewRating'; type: { kind: 'SCALAR'; name: 'Float'; ofType: null; } }; 'shortName': { name: 'shortName'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'translatableText': { name: 'translatableText'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; };
|
|
284
|
+
'ProductFilterParameter': { kind: 'INPUT_OBJECT'; name: 'ProductFilterParameter'; isOneOf: false; inputFields: [{ name: 'facetValueId'; type: { kind: 'INPUT_OBJECT'; name: 'IDOperators'; ofType: null; }; defaultValue: null }, { name: 'sku'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IDOperators'; ofType: null; }; defaultValue: null }, { name: 'createdAt'; type: { kind: 'INPUT_OBJECT'; name: 'DateOperators'; ofType: null; }; defaultValue: null }, { name: 'updatedAt'; type: { kind: 'INPUT_OBJECT'; name: 'DateOperators'; ofType: null; }; defaultValue: null }, { name: 'languageCode'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'slug'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'enabled'; type: { kind: 'INPUT_OBJECT'; name: 'BooleanOperators'; ofType: null; }; defaultValue: null }, { name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductFilterParameter'; ofType: null; }; }; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductFilterParameter'; ofType: null; }; }; }; defaultValue: null }, { name: 'infoUrl'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'downloadable'; type: { kind: 'INPUT_OBJECT'; name: 'BooleanOperators'; ofType: null; }; defaultValue: null }, { name: 'shortName'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'lastUpdated'; type: { kind: 'INPUT_OBJECT'; name: 'DateOperators'; ofType: null; }; defaultValue: null }, { name: 'reviewRating'; type: { kind: 'INPUT_OBJECT'; name: 'NumberOperators'; ofType: null; }; defaultValue: null }, { name: 'reviewCount'; type: { kind: 'INPUT_OBJECT'; name: 'NumberOperators'; ofType: null; }; defaultValue: null }, { name: 'translatableText'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }]; };
|
|
285
285
|
'ProductList': { kind: 'OBJECT'; name: 'ProductList'; fields: { 'items': { name: 'items'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Product'; ofType: null; }; }; }; } }; 'totalItems': { name: 'totalItems'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; }; };
|
|
286
286
|
'ProductListOptions': { kind: 'INPUT_OBJECT'; name: 'ProductListOptions'; isOneOf: false; inputFields: [{ name: 'skip'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'take'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'sort'; type: { kind: 'INPUT_OBJECT'; name: 'ProductSortParameter'; ofType: null; }; defaultValue: null }, { name: 'filter'; type: { kind: 'INPUT_OBJECT'; name: 'ProductFilterParameter'; ofType: null; }; defaultValue: null }, { name: 'filterOperator'; type: { kind: 'ENUM'; name: 'LogicalOperator'; ofType: null; }; defaultValue: null }]; };
|
|
287
287
|
'ProductOption': { kind: 'OBJECT'; name: 'ProductOption'; fields: { 'code': { name: 'code'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'customFields': { name: 'customFields'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; } }; 'group': { name: 'group'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductOptionGroup'; ofType: null; }; } }; 'groupId': { name: 'groupId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'languageCode': { name: 'languageCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'LanguageCode'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'translations': { name: 'translations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductOptionTranslation'; ofType: null; }; }; }; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
|
|
@@ -300,11 +300,13 @@ export type introspection_types = {
|
|
|
300
300
|
'ProductReviewSortParameter': { kind: 'INPUT_OBJECT'; name: 'ProductReviewSortParameter'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'createdAt'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'updatedAt'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'summary'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'body'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'rating'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'authorName'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'authorLocation'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'upvotes'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'downvotes'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'state'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'response'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'responseCreatedAt'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'reviewerName'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'verifiedReviewerName'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; };
|
|
301
301
|
'ProductReviewTranslation': { kind: 'OBJECT'; name: 'ProductReviewTranslation'; fields: { 'customFields': { name: 'customFields'; type: { kind: 'OBJECT'; name: 'ProductReviewTranslationCustomFields'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'languageCode': { name: 'languageCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'LanguageCode'; ofType: null; }; } }; 'text': { name: 'text'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; }; };
|
|
302
302
|
'ProductReviewTranslationCustomFields': { kind: 'OBJECT'; name: 'ProductReviewTranslationCustomFields'; fields: { 'reviewerName': { name: 'reviewerName'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; };
|
|
303
|
-
'
|
|
303
|
+
'ProductReviewTranslationInput': { kind: 'INPUT_OBJECT'; name: 'ProductReviewTranslationInput'; isOneOf: false; inputFields: [{ name: 'languageCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'LanguageCode'; ofType: null; }; }; defaultValue: null }, { name: 'text'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; }; defaultValue: null }, { name: 'customFields'; type: { kind: 'INPUT_OBJECT'; name: 'ProductReviewTranslationInputCustomFields'; ofType: null; }; defaultValue: null }]; };
|
|
304
|
+
'ProductReviewTranslationInputCustomFields': { kind: 'INPUT_OBJECT'; name: 'ProductReviewTranslationInputCustomFields'; isOneOf: false; inputFields: [{ name: 'reviewerName'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; };
|
|
305
|
+
'ProductSortParameter': { kind: 'INPUT_OBJECT'; name: 'ProductSortParameter'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'createdAt'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'updatedAt'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'slug'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'infoUrl'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'downloadable'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'shortName'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'lastUpdated'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'reviewRating'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'reviewCount'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'featuredReview'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }, { name: 'translatableText'; type: { kind: 'ENUM'; name: 'SortOrder'; ofType: null; }; defaultValue: null }]; };
|
|
304
306
|
'ProductTranslation': { kind: 'OBJECT'; name: 'ProductTranslation'; fields: { 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'customFields': { name: 'customFields'; type: { kind: 'OBJECT'; name: 'ProductTranslationCustomFields'; ofType: null; } }; 'description': { name: 'description'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'languageCode': { name: 'languageCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'LanguageCode'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'slug': { name: 'slug'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; }; };
|
|
305
|
-
'ProductTranslationCustomFields': { kind: 'OBJECT'; name: 'ProductTranslationCustomFields'; fields: { 'shortName': { name: 'shortName'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; };
|
|
307
|
+
'ProductTranslationCustomFields': { kind: 'OBJECT'; name: 'ProductTranslationCustomFields'; fields: { 'shortName': { name: 'shortName'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; 'translatableText': { name: 'translatableText'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; } }; }; };
|
|
306
308
|
'ProductTranslationInput': { kind: 'INPUT_OBJECT'; name: 'ProductTranslationInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }, { name: 'languageCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'LanguageCode'; ofType: null; }; }; defaultValue: null }, { name: 'name'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'slug'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'description'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'customFields'; type: { kind: 'INPUT_OBJECT'; name: 'ProductTranslationInputCustomFields'; ofType: null; }; defaultValue: null }]; };
|
|
307
|
-
'ProductTranslationInputCustomFields': { kind: 'INPUT_OBJECT'; name: 'ProductTranslationInputCustomFields'; isOneOf: false; inputFields: [{ name: 'shortName'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; };
|
|
309
|
+
'ProductTranslationInputCustomFields': { kind: 'INPUT_OBJECT'; name: 'ProductTranslationInputCustomFields'; isOneOf: false; inputFields: [{ name: 'shortName'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'translatableText'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }]; };
|
|
308
310
|
'ProductVariant': { kind: 'OBJECT'; name: 'ProductVariant'; fields: { 'assets': { name: 'assets'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Asset'; ofType: null; }; }; }; } }; 'channels': { name: 'channels'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Channel'; ofType: null; }; }; }; } }; 'createdAt': { name: 'createdAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'currencyCode': { name: 'currencyCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'CurrencyCode'; ofType: null; }; } }; 'customFields': { name: 'customFields'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; } }; 'enabled': { name: 'enabled'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; 'facetValues': { name: 'facetValues'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'FacetValue'; ofType: null; }; }; }; } }; 'featuredAsset': { name: 'featuredAsset'; type: { kind: 'OBJECT'; name: 'Asset'; ofType: null; } }; 'id': { name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'languageCode': { name: 'languageCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'LanguageCode'; ofType: null; }; } }; 'name': { name: 'name'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'options': { name: 'options'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductOption'; ofType: null; }; }; }; } }; 'outOfStockThreshold': { name: 'outOfStockThreshold'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'price': { name: 'price'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Money'; ofType: null; }; } }; 'priceWithTax': { name: 'priceWithTax'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Money'; ofType: null; }; } }; 'prices': { name: 'prices'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductVariantPrice'; ofType: null; }; }; }; } }; 'product': { name: 'product'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'Product'; ofType: null; }; } }; 'productId': { name: 'productId'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; } }; 'sku': { name: 'sku'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'stockAllocated': { name: 'stockAllocated'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'stockLevel': { name: 'stockLevel'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'String'; ofType: null; }; } }; 'stockLevels': { name: 'stockLevels'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'StockLevel'; ofType: null; }; }; }; } }; 'stockMovements': { name: 'stockMovements'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'StockMovementList'; ofType: null; }; } }; 'stockOnHand': { name: 'stockOnHand'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; 'taxCategory': { name: 'taxCategory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TaxCategory'; ofType: null; }; } }; 'taxRateApplied': { name: 'taxRateApplied'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'TaxRate'; ofType: null; }; } }; 'trackInventory': { name: 'trackInventory'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'GlobalFlag'; ofType: null; }; } }; 'translations': { name: 'translations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductVariantTranslation'; ofType: null; }; }; }; } }; 'updatedAt': { name: 'updatedAt'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; } }; 'useGlobalOutOfStockThreshold': { name: 'useGlobalOutOfStockThreshold'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; } }; }; };
|
|
309
311
|
'ProductVariantFilterParameter': { kind: 'INPUT_OBJECT'; name: 'ProductVariantFilterParameter'; isOneOf: false; inputFields: [{ name: 'facetValueId'; type: { kind: 'INPUT_OBJECT'; name: 'IDOperators'; ofType: null; }; defaultValue: null }, { name: 'enabled'; type: { kind: 'INPUT_OBJECT'; name: 'BooleanOperators'; ofType: null; }; defaultValue: null }, { name: 'trackInventory'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'stockOnHand'; type: { kind: 'INPUT_OBJECT'; name: 'NumberOperators'; ofType: null; }; defaultValue: null }, { name: 'stockAllocated'; type: { kind: 'INPUT_OBJECT'; name: 'NumberOperators'; ofType: null; }; defaultValue: null }, { name: 'outOfStockThreshold'; type: { kind: 'INPUT_OBJECT'; name: 'NumberOperators'; ofType: null; }; defaultValue: null }, { name: 'useGlobalOutOfStockThreshold'; type: { kind: 'INPUT_OBJECT'; name: 'BooleanOperators'; ofType: null; }; defaultValue: null }, { name: 'id'; type: { kind: 'INPUT_OBJECT'; name: 'IDOperators'; ofType: null; }; defaultValue: null }, { name: 'productId'; type: { kind: 'INPUT_OBJECT'; name: 'IDOperators'; ofType: null; }; defaultValue: null }, { name: 'createdAt'; type: { kind: 'INPUT_OBJECT'; name: 'DateOperators'; ofType: null; }; defaultValue: null }, { name: 'updatedAt'; type: { kind: 'INPUT_OBJECT'; name: 'DateOperators'; ofType: null; }; defaultValue: null }, { name: 'languageCode'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'sku'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'name'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'price'; type: { kind: 'INPUT_OBJECT'; name: 'NumberOperators'; ofType: null; }; defaultValue: null }, { name: 'currencyCode'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: 'priceWithTax'; type: { kind: 'INPUT_OBJECT'; name: 'NumberOperators'; ofType: null; }; defaultValue: null }, { name: 'stockLevel'; type: { kind: 'INPUT_OBJECT'; name: 'StringOperators'; ofType: null; }; defaultValue: null }, { name: '_and'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductVariantFilterParameter'; ofType: null; }; }; }; defaultValue: null }, { name: '_or'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductVariantFilterParameter'; ofType: null; }; }; }; defaultValue: null }]; };
|
|
310
312
|
'ProductVariantList': { kind: 'OBJECT'; name: 'ProductVariantList'; fields: { 'items': { name: 'items'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'OBJECT'; name: 'ProductVariant'; ofType: null; }; }; }; } }; 'totalItems': { name: 'totalItems'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; } }; }; };
|
|
@@ -467,7 +469,7 @@ export type introspection_types = {
|
|
|
467
469
|
'UpdateProductInput': { kind: 'INPUT_OBJECT'; name: 'UpdateProductInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'enabled'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: 'featuredAssetId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }, { name: 'assetIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; }; defaultValue: null }, { name: 'facetValueIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; }; defaultValue: null }, { name: 'translations'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductTranslationInput'; ofType: null; }; }; }; defaultValue: null }, { name: 'customFields'; type: { kind: 'INPUT_OBJECT'; name: 'UpdateProductCustomFieldsInput'; ofType: null; }; defaultValue: null }]; };
|
|
468
470
|
'UpdateProductOptionGroupInput': { kind: 'INPUT_OBJECT'; name: 'UpdateProductOptionGroupInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'code'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'translations'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductOptionGroupTranslationInput'; ofType: null; }; }; }; defaultValue: null }, { name: 'customFields'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; defaultValue: null }]; };
|
|
469
471
|
'UpdateProductOptionInput': { kind: 'INPUT_OBJECT'; name: 'UpdateProductOptionInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'code'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'translations'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductOptionGroupTranslationInput'; ofType: null; }; }; }; defaultValue: null }, { name: 'customFields'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; defaultValue: null }]; };
|
|
470
|
-
'UpdateProductReviewInput': { kind: 'INPUT_OBJECT'; name: 'UpdateProductReviewInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'summary'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'body'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'response'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'customFields'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; defaultValue: null }]; };
|
|
472
|
+
'UpdateProductReviewInput': { kind: 'INPUT_OBJECT'; name: 'UpdateProductReviewInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'summary'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'body'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'response'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'translations'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductReviewTranslationInput'; ofType: null; }; }; }; }; defaultValue: null }, { name: 'customFields'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; defaultValue: null }]; };
|
|
471
473
|
'UpdateProductVariantInput': { kind: 'INPUT_OBJECT'; name: 'UpdateProductVariantInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'enabled'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: 'translations'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ProductVariantTranslationInput'; ofType: null; }; }; }; defaultValue: null }, { name: 'facetValueIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; }; defaultValue: null }, { name: 'optionIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; }; defaultValue: null }, { name: 'sku'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'taxCategoryId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }, { name: 'price'; type: { kind: 'SCALAR'; name: 'Money'; ofType: null; }; defaultValue: null }, { name: 'prices'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'UpdateProductVariantPriceInput'; ofType: null; }; }; }; defaultValue: null }, { name: 'featuredAssetId'; type: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; defaultValue: null }, { name: 'assetIds'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; }; defaultValue: null }, { name: 'stockOnHand'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'stockLevels'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'StockLevelInput'; ofType: null; }; }; }; defaultValue: null }, { name: 'outOfStockThreshold'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'useGlobalOutOfStockThreshold'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: 'trackInventory'; type: { kind: 'ENUM'; name: 'GlobalFlag'; ofType: null; }; defaultValue: null }, { name: 'customFields'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; defaultValue: null }]; };
|
|
472
474
|
'UpdateProductVariantPriceInput': { kind: 'INPUT_OBJECT'; name: 'UpdateProductVariantPriceInput'; isOneOf: false; inputFields: [{ name: 'currencyCode'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'ENUM'; name: 'CurrencyCode'; ofType: null; }; }; defaultValue: null }, { name: 'price'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'Money'; ofType: null; }; }; defaultValue: null }, { name: 'delete'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: 'customFields'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; defaultValue: null }]; };
|
|
473
475
|
'UpdatePromotionInput': { kind: 'INPUT_OBJECT'; name: 'UpdatePromotionInput'; isOneOf: false; inputFields: [{ name: 'id'; type: { kind: 'NON_NULL'; name: never; ofType: { kind: 'SCALAR'; name: 'ID'; ofType: null; }; }; defaultValue: null }, { name: 'enabled'; type: { kind: 'SCALAR'; name: 'Boolean'; ofType: null; }; defaultValue: null }, { name: 'startsAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; defaultValue: null }, { name: 'endsAt'; type: { kind: 'SCALAR'; name: 'DateTime'; ofType: null; }; defaultValue: null }, { name: 'couponCode'; type: { kind: 'SCALAR'; name: 'String'; ofType: null; }; defaultValue: null }, { name: 'perCustomerUsageLimit'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'usageLimit'; type: { kind: 'SCALAR'; name: 'Int'; ofType: null; }; defaultValue: null }, { name: 'conditions'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ConfigurableOperationInput'; ofType: null; }; }; }; defaultValue: null }, { name: 'actions'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'ConfigurableOperationInput'; ofType: null; }; }; }; defaultValue: null }, { name: 'translations'; type: { kind: 'LIST'; name: never; ofType: { kind: 'NON_NULL'; name: never; ofType: { kind: 'INPUT_OBJECT'; name: 'PromotionTranslationInput'; ofType: null; }; }; }; defaultValue: null }, { name: 'customFields'; type: { kind: 'SCALAR'; name: 'JSON'; ofType: null; }; defaultValue: null }]; };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { extendDetailFormQuery } from '@/framework/document-extension/extend-detail-form-query.js';
|
|
2
|
+
import { useLingui } from '@/lib/trans.js';
|
|
3
|
+
import { DocumentNode } from 'graphql';
|
|
4
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
5
|
+
import { toast } from 'sonner';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @description
|
|
9
|
+
* Extends a detail page query document with any registered extensions provided by
|
|
10
|
+
* the `extendDetailDocument` function for the given page.
|
|
11
|
+
*/
|
|
12
|
+
export function useExtendedDetailQuery<T extends DocumentNode>(detailQuery: T, pageId?: string) {
|
|
13
|
+
const hasShownError = useRef(false);
|
|
14
|
+
const { i18n } = useLingui();
|
|
15
|
+
|
|
16
|
+
const extendedDetailQuery = useMemo(() => {
|
|
17
|
+
if (!pageId || !detailQuery) {
|
|
18
|
+
return detailQuery;
|
|
19
|
+
}
|
|
20
|
+
const result = extendDetailFormQuery(detailQuery, pageId);
|
|
21
|
+
if (result.errorMessage && !hasShownError.current) {
|
|
22
|
+
// Show a user-friendly toast notification
|
|
23
|
+
toast.error(i18n.t('Query extension error'), {
|
|
24
|
+
description:
|
|
25
|
+
result.errorMessage + '. ' + i18n.t('The page will continue with the default query.'),
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return result.extendedQuery;
|
|
29
|
+
}, [detailQuery, pageId]);
|
|
30
|
+
|
|
31
|
+
// Reset error flag when dependencies change
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
hasShownError.current = false;
|
|
34
|
+
}, [detailQuery, pageId]);
|
|
35
|
+
|
|
36
|
+
return extendedDetailQuery;
|
|
37
|
+
}
|