apollo-hooks-codegen icon indicating copy to clipboard operation
apollo-hooks-codegen copied to clipboard

Generated file fails noUnusedLocals tsc option

Open coreylight opened this issue 6 years ago • 0 comments

When using --noUnusedLocals tsc option, there are two vars that fail for my build: ApolloQueryResult and subscription. (dependent on feature usage I'm sure).

I had to use the add plugin for codegen to make my build pass like this:

  src/graphql.tsx:
    plugins:
      - 'apollo-hooks-codegen'
      - add: '/* Added to bypass noUnusedLocals tsconfig */ type Ditch = ApolloQueryResult<any>; const noop = (...args: Ditch | any) => void args; noop(subscription);'

This works but perhaps this lib could output the vars that are only needed/used to improve this experience.

coreylight avatar Apr 11 '19 12:04 coreylight