Anchor to fulfillmentConstraintRuleCreatefulfillment
fulfillmentConstraintRuleCreate
mutation
Requires access scope.
Creates a fulfillment constraint rule and its metafield.
Anchor to Arguments
Arguments
- Anchor to functionIdfunction•
Id String!required The identifier of the function providing the constraint rule.
- Anchor to metafieldsmetafields•[Metafield
Input!] Default:[] Metafields to associate to the fulfillment constraint rule.
Was this section helpful?
Anchor to FulfillmentConstraintRuleCreatePayload returnsFulfillmentConstraintRuleCreatePayload returns
- Anchor to fulfillmentConstraintRulefulfillment•
Constraint Rule The newly created fulfillment constraint rule.
- Anchor to userErrorsuser•
Errors The list of errors that occurred from executing the mutation.
Was this section helpful?
Mutation Reference
1mutation fulfillmentConstraintRuleCreate($functionId: String!, $metafields: [MetafieldInput!]) {2 fulfillmentConstraintRuleCreate(functionId: $functionId, metafields: $metafields) {3 fulfillmentConstraintRule {4 # FulfillmentConstraintRule fields5 }6 userErrors {7 field8 message9 }10 }11}
Input
1{2 "functionId": "<your-functionId>",3 "metafields": [4 {5 "id": "gid://shopify/<objectName>/10079785100",6 "key": "<your-key>",7 "namespace": "<your-namespace>",8 "type": "<your-type>",9 "value": "<your-value>"10 }11 ]12}
{
"functionId": "<your-functionId>",
"metafields": [
{
"id": "gid://shopify/<objectName>/10079785100",
"key": "<your-key>",
"namespace": "<your-namespace>",
"type": "<your-type>",
"value": "<your-value>"
}
]
}
input MetafieldInput {
description: String
id: ID
key: String
namespace: String
type: String
value: String
}