1

I am using this https://github.com/dotansimha/graphql-code-generator for GraphQL code generation. The cli output is as below. Something is wrong with the "Generate outputs" because I am getting duplicate entities when generating the code, but since it is in cli, i am not able to expand the part. How do I expand and see what is happening there.

$ yarn gen
yarn run v1.22.17
$ graphql-codegen --config codegen.ts
✔ Parse Configuration
❯ Generate outputs
✔ Parse Configuration
✔ Generate outputs
Done in 3.71s.

Image

1 Answers1

0

After configuring the details in codegen.yml/ts one of the fields is responsible where to generate the output.

please see the ./dist/output/: line. this is where the generated code will be based on this config. It can also be a single file.

reference: https://the-guild.dev/graphql/codegen/docs/config-reference/codegen-config

example:

schema: '**/*.graphql'
documents:
    - './src/**/*.graphql'
generates:
    ./dist/output/:
        preset: client-preset
        plugins:
            - typescript
            - typescript-resolvers            

        
Peter Koller
  • 312
  • 3
  • 16