Graphql-code-generator: Duplicate import gql from 'graphql-tag'

Created on 14 Feb 2020  ·  4Comments  ·  Source: dotansimha/graphql-code-generator

Duplicate import gql from 'graphql-tag'
Снимок экрана 2020-02-14 в 11 58 10 AM
Снимок экрана 2020-02-14 в 11 58 47 AM

codegen.yml



overwrite: true

documents: "src/**/*.graphql"

config:
  skipTypename: true
  avoidOptionals:
    inputValue: false
    object: true
  strict: true
  preResolveTypes: true
  scalars:
    timestamptz: string
    uuid: string
    jsonb: "{ [key: string]: any }"

generates:
  src/generate.ts:
    plugins:
      - add: '/* eslint:disable */'
      - "typescript"
      - "typescript-operations"
      - "typescript-document-nodes"
      - "typescript-graphql-request"
bug plugins waiting-for-release

All 4 comments

@polRk

I pushed a fix for the duplications, can you please try the alpha? 1.12.3-alpha-ed40601c.37

Thanks!

@dotansimha, Yes i can, I'll do it next week.

Is it possible to NOT import gql?
"typescript-graphql-request" uses print to convert it to a string anyways, so it seems like an unnecessary addition to the bundle size..

Fixed in v1.13.0

@Aleksion you can either use documentNode or noGraphQlTag option for that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SimenB picture SimenB  ·  3Comments

mszczepanczyk picture mszczepanczyk  ·  3Comments

quolpr picture quolpr  ·  3Comments

NickClark picture NickClark  ·  3Comments

fvisticot picture fvisticot  ·  3Comments