Fix flickering warehouse list in variant details (#2009)

* Fix merge functionin cached stocks

* Revert "Fix merge functionin cached stocks"

This reverts commit caf4956fde78abe33e893ed8b095f6275f73ef37.

* Change mutation order
This commit is contained in:
Michał Droń 2022-05-10 13:27:20 +02:00 committed by GitHub
parent 8fee2ccd4b
commit 2d71c138b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 55 deletions

View file

@ -11315,24 +11315,16 @@ export type VariantDeleteMutationResult = Apollo.MutationResult<Types.VariantDel
export type VariantDeleteMutationOptions = Apollo.BaseMutationOptions<Types.VariantDeleteMutation, Types.VariantDeleteMutationVariables>;
export const VariantUpdateDocument = gql`
mutation VariantUpdate($addStocks: [StockInput!]!, $removeStocks: [ID!]!, $id: ID!, $attributes: [AttributeValueInput!], $sku: String, $quantityLimitPerCustomer: Int, $trackInventory: Boolean!, $stocks: [StockInput!]!, $preorder: PreorderSettingsInput, $weight: WeightScalar, $firstValues: Int, $afterValues: String, $lastValues: Int, $beforeValues: String) {
productVariantUpdate(
id: $id
input: {attributes: $attributes, sku: $sku, trackInventory: $trackInventory, preorder: $preorder, weight: $weight, quantityLimitPerCustomer: $quantityLimitPerCustomer}
) {
productVariantStocksDelete(warehouseIds: $removeStocks, variantId: $id) {
errors {
...ProductErrorWithAttributes
...ProductVariantStocksDeleteError
}
productVariant {
...ProductVariant
id
stocks {
...Stock
}
}
productVariantStocksUpdate(stocks: $stocks, variantId: $id) {
errors {
...BulkStockError
}
productVariant {
...ProductVariant
}
}
productVariantStocksCreate(stocks: $addStocks, variantId: $id) {
errors {
@ -11345,23 +11337,31 @@ export const VariantUpdateDocument = gql`
}
}
}
productVariantStocksDelete(warehouseIds: $removeStocks, variantId: $id) {
productVariantStocksUpdate(stocks: $stocks, variantId: $id) {
errors {
...ProductVariantStocksDeleteError
...BulkStockError
}
productVariant {
id
stocks {
...Stock
...ProductVariant
}
}
productVariantUpdate(
id: $id
input: {attributes: $attributes, sku: $sku, trackInventory: $trackInventory, preorder: $preorder, weight: $weight, quantityLimitPerCustomer: $quantityLimitPerCustomer}
) {
errors {
...ProductErrorWithAttributes
}
productVariant {
...ProductVariant
}
}
}
}
${ProductErrorWithAttributesFragmentDoc}
${ProductVariantFragmentDoc}
${BulkStockErrorFragmentDoc}
${ProductVariantStocksDeleteErrorFragmentDoc}
${StockFragmentDoc}
${ProductVariantStocksDeleteErrorFragmentDoc}`;
${BulkStockErrorFragmentDoc}
${ProductVariantFragmentDoc}
${ProductErrorWithAttributesFragmentDoc}`;
export type VariantUpdateMutationFn = Apollo.MutationFunction<Types.VariantUpdateMutation, Types.VariantUpdateMutationVariables>;
/**

File diff suppressed because one or more lines are too long

View file

@ -210,6 +210,36 @@ export const variantUpdateMutation = gql`
$lastValues: Int
$beforeValues: String
) {
productVariantStocksDelete(warehouseIds: $removeStocks, variantId: $id) {
errors {
...ProductVariantStocksDeleteError
}
productVariant {
id
stocks {
...Stock
}
}
}
productVariantStocksCreate(stocks: $addStocks, variantId: $id) {
errors {
...BulkStockError
}
productVariant {
id
stocks {
...Stock
}
}
}
productVariantStocksUpdate(stocks: $stocks, variantId: $id) {
errors {
...BulkStockError
}
productVariant {
...ProductVariant
}
}
productVariantUpdate(
id: $id
input: {
@ -228,36 +258,6 @@ export const variantUpdateMutation = gql`
...ProductVariant
}
}
productVariantStocksUpdate(stocks: $stocks, variantId: $id) {
errors {
...BulkStockError
}
productVariant {
...ProductVariant
}
}
productVariantStocksCreate(stocks: $addStocks, variantId: $id) {
errors {
...BulkStockError
}
productVariant {
id
stocks {
...Stock
}
}
}
productVariantStocksDelete(warehouseIds: $removeStocks, variantId: $id) {
errors {
...ProductVariantStocksDeleteError
}
productVariant {
id
stocks {
...Stock
}
}
}
}
`;