relay-compiler-language-typescript icon indicating copy to clipboard operation
relay-compiler-language-typescript copied to clipboard

Fragment Typematching

Open fameoflight opened this issue 3 years ago • 0 comments

I am sorry if this is not appropriate place to ask this question.

How do I get type when passing fragment, right now I have typecast them to any for typescript to stop complaining

Example

const CompanyHomePageQuery = graphql`
  query CompanyHomeQuery {
    viewer {
     id
     apps {
       id
       ...AppHomeIcon_app
     }
    }
  }
`

Now in my code fragment I have to do this

<AppHomeIcon
    key={app.id}
    app={app as any} // this is the problem I am trying to avoid
/>

fameoflight avatar Dec 20 '21 17:12 fameoflight