-
create vendure2 postgres DB
yarn
yarn migration:run
yarn populate
yarn dev
open http://localhost:3000/shop-api
run
mutation addItemToOrder($productVariantId: ID!, $quantity: Int!, $customFields: OrderLineCustomFieldsInput!) {
addItemToOrder(productVariantId: $productVariantId, quantity: $quantity, customFields: $customFields) {
__typename
}
}
Query Variables
{
"productVariantId": "1",
"quantity": 1,
"customFields": {
"materialId": "2"
}
}
run
query activeOrder {
activeOrder {
...OrderDetail
}
}
fragment OrderDetail on Order {
__typename
lines {
customFields {
material {
__typename
}
}
}
}