graphql-let icon indicating copy to clipboard operation
graphql-let copied to clipboard

Works with @graphql-codegen/add?

Open pokutuna opened this issue 5 years ago • 2 comments

There is an example in the README for use with @graphql-codegen/add. https://github.com/piglovesyou/graphql-let#graphql-let-specific-options

But I couldn't get the generated codes including the section. Small reproduction codes & generated codes. https://gist.github.com/pokutuna/d3bb746eed98ba6073f21817afd7574c

pokutuna avatar Aug 23 '20 17:08 pokutuna

Hey, I confirm this. I wanted to use @graphql-codegen/add of version 2.0.2, but the line is not added on top of the files.

BTW, as of version 2.0.0, the plugin configuration requires the content: part, so the README is outdated as well: https://github.com/dotansimha/graphql-code-generator/blob/master/packages/plugins/other/add/CHANGELOG.md#200

Is this planned to be fixed anytime soon?

rtrembecky avatar May 29 '21 09:05 rtrembecky

Hit the same issue here, was trying to add DeepPartial to allow for partial results, but the import is never added to the output, and that causes errors like property 'Boolean' of exported interface has or is using private name 'DeepPartial'.

My config changes:

plugins:
  - typescript-operations
  - typescript-react-apollo
  - add:
      content: "import { DeepPartial } from 'utility-types';"
config:
  defaultMapper: DeepPartial<{T}>

danielb7390 avatar Oct 26 '21 19:10 danielb7390