updateGiftRegistryItems mutation
The updateGiftRegistryItems
mutation modifies the requested quantity of an item in the specified gift registry. It can also change the description of the item.
This mutation requires a valid customer authentication token.
Syntax
1
2
3
4
5
6
7
8
mutation {
updateGiftRegistryItems(
giftRegistryUid: ID!,
items: [UpdateGiftRegistryItemInput!]!
) {
UpdateGiftRegistryItemsOutput
}
}
Example usage
The following example changes the quantity and description of an item in a gift registry
Request:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
mutation{
updateGiftRegistryItems(giftRegistryUid: "iSJHFdAtF8YBM5ALgNyNIgQmnbOW9t69",
items: [{
gift_registry_item_uid: "OQ=="
quantity: 3
note: "This is the number one thing on our list."}
]){
gift_registry {
uid
event_name
items {
uid
product {
sku
}
quantity
quantity_fulfilled
}
}
}
}
Response:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
"data": {
"updateGiftRegistryItems": {
"gift_registry": {
"uid": "iSJHFdAtF8YBM5ALgNyNIgQmnbOW9t69",
"event_name": "Bill and Julie's wedding",
"items": [
{
"uid": "OQ==",
"product": {
"sku": "24-WB03"
},
"quantity": 3,
"quantity_fulfilled": 0
},
{
"uid": "MTM=",
"product": {
"sku": "24-WB02"
},
"quantity": 1,
"quantity_fulfilled": 0
}
]
}
}
}
}
Input attributes
The updateGiftRegistryItems
mutation requires the following input.
Attribute | Data Type | Description |
---|---|---|
giftRegistryUid |
ID! | The unique ID of a GiftRegistry object |
items |
[UpdateGiftRegistryItemInput!]! | An array of items to update |
UpdateGiftRegistryItemInput attributes
Attribute | Data Type | Description |
---|---|---|
gift_registry_item_uid |
ID! | The unique ID of a giftRegistryItem object |
note |
String | The updated description of the item |
quantity |
Float! | The updated quantity of the gift registry item |
Output attributes
The UpdateGiftRegistryItemsOutput
output object contains the following attribute.
Attribute | Data Type | Description |
---|---|---|
gift_registry |
GiftRegistry | The gift registry after updating items |
GiftRegistry attributes
The GiftRegistry
object returns the following attributes:
Attribute | Data Type | Description |
---|---|---|
created_at |
String! | The date on which the gift registry was created. Only the registry owner can access this attribute |
dynamic_attributes |
[GiftRegistryDynamicAttribute] | An array of attributes that define elements of the gift registry. Each attribute is specified as a code-value pair |
event_name |
String! | The name the customer assigned to the event |
items |
[GiftRegistryItemInterface] | An array of products added to the gift registry |
message |
String! | The message text the customer entered to describe the event |
owner_name |
String! | The customer who created the gift registry |
privacy_settings |
GiftRegistryPrivacySettings! | An enum that states whether the gift registry is PRIVATE or PUBLIC. Only the registry owner can access this attribute |
registrants |
[GiftRegistryRegistrant] | Contains details about each registrant for the event |
shipping_address |
CustomerAddress | Contains the customer’s shipping address. Only the registry owner can access this attribute |
status |
GiftRegistryStatus! | An enum that states whether the gift registry is ACTIVE or INACTIVE. Only the registry owner can access this attribute |
type |
[GiftRegistryType] | Contains details about the type of gift registry |
uid |
ID! | The unique ID assigned to the gift registry |
GiftRegistryDynamicAttribute attributes
The GiftRegistryDynamicAttribute
object implements GiftRegistryDynamicAttributeInterface
. It also defines the following attribute.
Attribute | Data Type | Description |
---|---|---|
group |
GiftRegistryDynamicAttributeGroup! | An enum that categorizes the dynamic attribute set. The possible values are EVENT_INFORMATION, PRIVACY_SETTINGS, REGISTRANT, GENERAL_INFORMATION, DETAILED_INFORMATION, and SHIPPING_ADDRESS. |
GiftRegistryDynamicAttributeInterface attributes
The GiftRegistryDynamicAttribute
and GiftRegistryRegistrantDynamicAttribute
data types implement the GiftRegistryDynamicAttributeInterface
.
This interface contains the following attributes:
Attribute | Data type | Description |
---|---|---|
code |
ID! | The internal ID of the dynamic attribute |
label |
String! | The display name of the dynamic attribute |
value |
String! | A corresponding value for the code |
GiftRegistryDynamicAttributeMetadataInterface
The GiftRegistryDynamicAttributeMetadata
data type implements the GiftRegistryDynamicAttributeMetadataInterface
.
This interface contains the following attributes:
Attribute | Data Type | Description |
---|---|---|
attribute_group |
String! | Indicates which group of the dynamic attribute a member of |
code |
ID! | The internal ID of the dynamic attribute |
input_type |
String! | The input type of the dynamic attribute |
is_required |
Boolean! | Indicates whether the dynamic attribute is required |
label |
String! | The display name of the dynamic attribute |
sort_order |
Int | The order in which to display the dynamic attribute |
GiftRegistryItemInterface attributes
This GiftRegistryItemInterface
contains the following attributes:
Attribute | Data Type | Description |
---|---|---|
created_at |
String! | The date the product was added to the gift registry |
note |
String | A brief message about the gift registry item |
product |
ProductInterface | The details about the product |
quantity |
Float! | The requested quantity of the product |
quantity_fulfilled |
Float! | The fulfilled quantity of the product |
uid |
ID! | The unique ID assigned to the gift registry item |
GiftRegistryRegistrant attributes
The GiftRegistryRegistrant
object contains the following attributes:
Attribute | Data type | Description |
---|---|---|
dynamic_attributes |
[GiftRegistryRegistrantDynamicAttribute] | An array of attributes that define elements of the gift registry. Each attribute is specified as a code-value pair |
email |
String! | The email address of the registrant. Only the registry owner can access this attribute |
firstname |
String! | The first name of the registrant |
lastname |
String! | The last name of the registrant |
uid |
ID! | The unique ID assigned to the registrant |
GiftRegistryRegistrantDynamicAttribute attributes
The GiftRegistryRegistrantDynamicAttribute
data type implements the GiftRegistryDynamicAttributeInterface
. It does not introduce any additional attributes.
GiftRegistryType attributes
The GiftRegistryType
object contains the following attributes:
Attribute | Data type | Description |
---|---|---|
dynamic_attributes_metadata |
[GiftRegistryDynamicAttributeMetadataInterface] | An array of attributes that define elements of the gift registry. Each attribute is specified as a code-value pair |
label |
String! | The display name of the gift registry type |
uid |
ID! | The unique ID assigned to the gift registry type |