question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Describe the bug productVariant price 0

To Reproduce I create my own RtsCart plugin which allow user add items to cart but not order. Then pick a few item to real order. Everything works good, and the productVariantId related productVariant most props is OK, only price 0, and priceWithTax 0

//gql
mutation addRtsCart($input: AddRtsCartInput!){
  addRtsCart(input: $input){
    id productVariantId  
    customer {
      rtsCartList (options: {take: 100}) {
        totalItems
        items {
          id productVariantId
          productVariant {
            id name price priceWithTax sku 
            assets {
              source preview
            }
          }
        }
      }
    }
  }
}

//plugin code
@ResolveField()
  async productVariant(@Parent() record: RtsCart, @Ctx() ctx: RequestContext) {
    let productVariant: ProductVariant | null = record.productVariant;
    if (!productVariant) {
      const recordWithProductVariant = await this.connection
        .getRepository(ctx, RtsCart)
        .findOne(record.id, {
          relations: ['productVariant'],
        });
      if (recordWithProductVariant) {
        productVariant = recordWithProductVariant.productVariant;
      }
    }
    if (productVariant) {
      return translateDeep(productVariant, ctx.languageCode);
    }
  }

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
roytan883commented, Aug 11, 2022

@michaelbromley after add { relations: ['taxCategory'] }, it can get price now.

0reactions
roytan883commented, Aug 11, 2022

OK, it works now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Zero price effect - Market - Subwiki
The zero price effect is a phenomenon whereby the demand for a good, service, or commodity is significantly greater at a price of...
Read more >
Zero price - Wikipedia
Zero price may refer to: Free of charge, a price of zero; The offering price of a Zero-coupon bond or its financial equivalent....
Read more >
Zero Price | ZER Price, USD converter, Charts - Crypto.com
Zero's price today is US$0.01095, with a 24-hour trading volume of $19. ZER is +10.22% in the last 24 hours. It is currently...
Read more >
ZERO Price Index, Live Chart and USD Converter - Binance
The live price of Zero is $ 0.0338849 per (ZERO / USD) today with a current market cap of $ 0 USD. 24-hour...
Read more >
Zero price today, ZER to USD live, marketcap and chart
The live Zero price today is $0.009976 USD with a 24-hour trading volume of $16.80 USD. We update our ZER to USD price...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found