graphql-code-generator: Errors during generation are non-existent

Describe the bug

I’ve recently updated to v2 of the CLI and the associated plugins. Since then the errors that are reported are not helpful in that only a partial of the error is displayed. This makes tracking down errors extremely more challenging. Please see the below screenshots and information. I have used the debug and errorsOnly flags and they do not provide any additional information toward identifying the reason and therefore cause of the failure.

Your Example Website or App

None provided

Steps to Reproduce the Bug or Issue

To reproduce I have the following CLI version and plugins installed which at the time are the most current versions. Create a query/mutation that is incorrect or doesn’t exist to cause any error in generation. Review the reported errors.

Expected behavior

As a user, I am expecting to see detailed enough errors to allow me to track down my errors to resolve. Version 1 of the CLI provided adequate information around errors.

Screenshots or Videos

image image

Platform

To reproduce I have the following CLI version and plugins installed which at the time are the most current versions.

Codegen Config File

schema:
  - https://graphql-federated-gateway...../graphql
  - 'schema.graphql'
documents: './src/**/*.graphql'
generates:
  ./src/generated/graphql.tsx:
    config:
      enumsAsConst: true
    plugins:
      - typescript
      - typescript-operations
      - typed-document-node

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 17 (8 by maintainers)

Most upvoted comments

It appears graphql-codegen/cli@2.9.1 introduced the issue

@pleunv any feedback with the canary version suggested above?

Apologies, completely missed this. Just want to confirm that this does in fact also fix the issue for us. Thank you!

@charlypoly I just encountered this problem, and tried out the changes you made in #8525, and they do appear to resolve the issues.

@charlypoly I can confirm downgrading the version to 2.9.0 is working well on Mac. If I install version 2.10.0 or above it doesn’t work.

@chriswetterman, okay, we will investigate further.

@wesselvdv, do you also face this issue on Windows or on another OS?

I am seeing the same issue, errors are no longer being displayed. The only thing I get is the following statement Unable to validate GraphQL document!, but where it is, is not being shown. It did do this before.