File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed
packages/api-client/src/api Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default async (
1414 {
1515 cart : {
1616 query : cart ,
17- variables : { cartId } ,
17+ variables : { cartId : cartId ?? '' } ,
1818 } ,
1919 } ,
2020 ) ;
Original file line number Diff line number Diff line change 11import gql from 'graphql-tag' ;
22
33export default gql `
4- query cart ($cartId: String!) {
4+ query cartTotalQty ($cartId: String!) {
55 cart(cart_id:$cartId) {
66 total_quantity
77 }
Original file line number Diff line number Diff line change 11import { ApolloQueryResult } from '@apollo/client/core' ;
22import { CustomQuery } from '@vue-storefront/core' ;
33import { CartQuery , CartQueryVariables } from '../../types/GraphQL' ;
4- import cart from './cartTotalQty' ;
4+ import query from './cartTotalQty' ;
55import { Context } from '../../types/context' ;
66
77export default async (
88 context : Context ,
99 cartId : string ,
10- customQuery : CustomQuery = { cart : 'cart ' } ,
10+ customQuery : CustomQuery = { cartTotalQty : 'cartTotalQty ' } ,
1111) : Promise < ApolloQueryResult < CartQuery > > => {
12- const { cart : cartGQL } = context . extendQuery (
12+ const { cartTotalQty } = context . extendQuery (
1313 customQuery ,
1414 {
15- cart : {
16- query : cart ,
17- variables : { cartId } ,
15+ cartTotalQty : {
16+ query,
17+ variables : { cartId : cartId ?? '' } ,
1818 } ,
1919 } ,
2020 ) ;
2121 return context . client . query < CartQuery , CartQueryVariables > ( {
22- query : cartGQL . query ,
23- variables : cartGQL . variables ,
22+ query : cartTotalQty . query ,
23+ variables : cartTotalQty . variables ,
2424 } ) ;
2525} ;
You can’t perform that action at this time.
0 commit comments