graphql-code-generator icon indicating copy to clipboard operation
graphql-code-generator copied to clipboard

fragment-matcher generated code is wrongly indented

Open sschneider-ihre-pvs opened this issue 5 years ago • 3 comments

Describe the bug

When using the fragment-matcher plugin against a graphql server this is the result of the generated code. image

To Reproduce Steps to reproduce the behavior: use fragment-matcher plugin. Possibly have not fragments to match.

  1. My GraphQL schema:
# Put your schema here
  1. My GraphQL operations:
# Put your operations here
  1. My codegen.yml config file:
overwrite: true
schema: "http://localhost:3000/graphql"
documents: null
generates:
  src/types/graphql-generated.ts:
    plugins:
      - "typescript"
      - "fragment-matcher"

sschneider-ihre-pvs avatar Sep 01 '21 10:09 sschneider-ihre-pvs

This is not really a critical issue but would be a great opportunity for new contributors. Feel free to send a PR that addresses this :)

n1ru4l avatar Sep 03 '21 11:09 n1ru4l

This no longer reproduces on current master (b71b9d5). The .ts, .js and .json outputs of fragment-matcher are indented correctly, both with and without unions in the schema. Probably safe to close.

nomadical avatar Nov 25 '26 01:11 nomadical

Thanks @nomadical for the reminder!

This was released in 7.1.1 https://github.com/dotansimha/graphql-code-generator/blob/b71b9d5e9265a1bbd4266090de8c9689d27e3ee2/packages/plugins/other/fragment-matcher/CHANGELOG.md?plain=1#L60-L69

eddeee888 avatar Nov 25 '26 11:11 eddeee888