我有一個為我提供 api 的服務,他們正在使用 GraphQL。
除了本節之外,其他一切似乎都運行良好。
我正在使用以下查詢來創建訂單,除了在那里添加通知之外,它運行良好
我收到此錯誤 InputObject 'OrderCreateMutationInput' 上的 Argument 'notifications' has an invalid value ({type: {OrderCreationNotificationEnum: {email: true}}})。預期型別 '[OrderCreationNotificationEnum!]'
mutation{
orderCreate(input: {
order: {
externalIds:[
{key: "VRPOrderId", value: "abc131"}
]
firstName: "John"
surname: "Doe"
phone: "0405123456"
billingFirstName: "John"
billingSurname: "Doe"
billingEmailAddress: "[email protected]"
address: {
address: "1 Bourke Street"
city: "Melbourne"
country: {
code: "AU"
}
postcode: "3000"
state: {
short: "VIC"
}
}
billingAddress:{
address: "1 Bourke Street"
city: "Melbourne"
country: {
code: "AU"
}
postcode: "3000"
state: {
short: "VIC"
}
}
termsAndConditionsAccepted: true
}
lineItems: [
{
variantId: "VmFyaWFudC00NzMz"
quantity: 1
totalCents: 22500
postageCents: 1000
},
{
variantId: "VmFyaWFudC00NzYy"
quantity: 1
totalCents: 22500
postageCents: 500
}
]
notifications:
{
type: {
OrderCreationNotificationEnum: {
email: true
}
}
}
})
{
order{
id
invoices{
edges{
node{
id
lineItems{
id
quantity
}
}
}
}
}
status
}
}
我正在努力使通知正常作業。我也在添加說明的鏈接。請幫忙。
鏈接到 api 檔案
uj5u.com熱心網友回復:
InputObject 'OrderCreateMutationInput '上的引數 'notifications'是一個Enum:
enum OrderCreationNotificationEnum {
# Notify the order information via Email
EMAIL
# Notify the order information via SMS
SMS
}
對于通知,您應該指定一個列舉值陣列,如下所示:
notifications: [EMAIL, SMS]
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/339002.html
下一篇:.map不是函式(api結果)
