Skip to content

Generated file fails noUnusedLocals tsc option #3

@coreylight

Description

@coreylight

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions