Describe the bug
When a document has an issue, eg. querying a field that doesn't exist, the tool would previously report the location of the offending file. Now it just reports the error, and I have no idea which document the error is in.
To Reproduce
Run yarn generate in the reproduction repo in sandbox for this issue.
type Query {
user(id: ID!): User!
}
type User {
id: ID!
username: String!
email: String!
}
query user {
user(id: 1) {
id
username
email
i_do_not_exist
}
}
codegen.yml config file:schema: schema.graphql
documents: document.graphql
generates:
types.ts:
plugins:
- typescript
- typescript-operations
Expected behavior
The errors shown in the console when running yarn generate in the reproduction repo in sandbox for this issue should inidcate wich file is responsible for the error.
Environment:
@graphql-codegen/*: 1.15.3@ardatan It seems like an issue with graphql-tools. Can you please take a look?
In the example @aryzing shared, it looks like the issue is coming from the checkValidationErrors - this method swallows the error details. In the original GraphQLError it seems like it exists:
[
Error [GraphQLDocumentError]: Cannot query field "i_do_not_exist" on type "User".
at document.graphql:6:9 {
name: 'GraphQLDocumentError',
message: 'GraphQLDocumentError: Cannot query field "i_do_not_exist" on type "User".'
}
]
Fixed in v1.15.4
Most helpful comment
Fixed in v1.15.4