Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
Cannot read a property from a type which is an union of two types

I have two types defined:

type Filter_Facets_StoreFacetBoolean_Fragment = {
   key: string
   label: string
   values: Array<{
      label: string
      value: string
      selected: boolean
      quantity: number
   }>
}

type Filter_Facets_StoreFacetRange_Fragment = {
   key: string
   label: string
   min: {
      selected: number
      absolute: number
   },
   max: {
      selected: number
      absolute: number
   }
}

and I have another type that is made of these two:

export type Filter_FacetsFragment = Filter_Facets_StoreFacetBoolean_Fragment | Filter_Facets_StoreFacetRange_Fragment

In the code when I tried to use the Filter_FacetsFragment, typescript debug gives me the following error:

Property 'values' does not exist on type 'Filter_FacetsFragment'.

Property 'values' does not exist on type 'Filter_Facets_StoreFacetRange_Fragment'.

How to correct this error? Thanks in advance.

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!