Graphql-code-generator: 'Add' plugin adds an empty line

Created on 6 Aug 2020  路  4Comments  路  Source: dotansimha/graphql-code-generator

I'm constructing a schema.graphql file with the AST plugin and also want to add a comment to the top. This is from my codegen.yml:

generates:
  schema.graphql:
    schema:
      - schema-source.ts
    plugins:
      - schema-ast
      - add:
          content: '# Generated - DO NOT EDIT'

Besides prepending the content, it also appends an empty line which feels like a bug to me:

Screenshot 2020-08-06 at 10 17 13

bug plugins waiting-for-release

All 4 comments

Are you using the v2 of the add plugin? or v1?

It's v2, according to my yarn.lock.

Thanks @borekb ! I think I managed to reproduce it and fix it. Pushed to a PR with some other minor bugs: https://github.com/dotansimha/graphql-code-generator/pull/4554

Fixed in @graphql-codegen/[email protected]

Was this page helpful?
0 / 5 - 0 ratings