Validation Settings API
This API is available to Validation Settings extensions. Refer to the tutorial for more information. Note that the component is required to build Validation Settings extensions.
Applies a change to the validation settings.
- Anchor to changechangeMetafieldChangerequired
Promise<MetafieldChangeResult>
MetafieldChange
MetafieldUpdateChange | MetafieldRemoveChangeMetafieldUpdateChange
- key
string - namespace
string - type
"updateMetafield" - value
string | number - valueType
SupportedDefinitionType
interface MetafieldUpdateChange {
type: 'updateMetafield';
key: string;
namespace?: string;
value: string | number;
valueType?: SupportedDefinitionType;
}SupportedDefinitionType
(typeof supportedDefinitionTypes)[number]MetafieldRemoveChange
- key
string - namespace
string - type
"removeMetafield"
interface MetafieldRemoveChange {
type: 'removeMetafield';
key: string;
namespace: string;
}MetafieldChangeResult
MetafieldChangeSuccess | MetafieldChangeResultErrorMetafieldChangeSuccess
- type
"success"
interface MetafieldChangeSuccess {
type: 'success';
}MetafieldChangeResultError
- message
string - type
"error"
interface MetafieldChangeResultError {
type: 'error';
message: string;
}Anchor to datadata
The object that exposes the validation with its settings.
- Anchor to shopifyFunctionshopifyFunctionShopifyFunctionrequired
- Anchor to validationvalidationValidation
ShopifyFunction
- id
the validation function's unique identifier
string
interface ShopifyFunction {
/**
* the validation function's unique identifier
*/
id: string;
}Validation
- id
the validation's gid when active in a shop
string - metafields
the metafields owned by the validation
Metafield[]
interface Validation {
/**
* the validation's gid when active in a shop
*/
id: string;
/**
* the metafields owned by the validation
*/
metafields: Metafield[];
}Metafield
- description
string - id
string - key
string - namespace
string - type
string - value
string
interface Metafield {
description?: string;
id: string;
namespace: string;
key: string;
value: string;
type: string;
}Was this page helpful?