-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property '0' of undefined #308
Comments
we hit it too. i added some debugging in
and (ironically) this seems to be one error that's exploding for me:
|
Ah, darn. 😢 It would definitely be easier to debug this with a schema. It could be worth double checking if this happens with Even better, if you can make it crash with a shareable subset of your schema that would make fixing this easier. Is there anything about your schema that might be out of the ordinary? I ask because I've got a series of small fake schemas that work fine. Edit: Are you using comments as type descriptions by any chance? 🤔 |
@cjoudrey I just checked - with I've tried to pin-point which file would be causing this, but the schema is so interlinked that, without more knowledge about GraphQL itself, I'm afraid I'm not able to. Could you provide an example of what you mean by |
Thanks for the debugging! 🙂 I suspect that might be the issue, but the linter should gracefully handle this. Crashing is not a great user experience. Comment descriptions have been deprecated for some time now. As of GraphQL 16.x, I believe comment descriptions were officially removed and replaced with string literal descriptions. I'll need to confirm this is the issue once I am in front of my computer. Hope that helps for now. |
@cjoudrey Oh, do you mean this: type Example {
# This is a comment description
comment: String
"This is a string literal description"
literal: String
} I grepped all our schemas, |
i also checked and even with all i wonder if just fixing |
This issue should be addressed by: #309. I'll make a release shortly. |
After installing following packages:
And running the
graphql-schema-linter
:I hate to post such empty issue, but no clue what more information I could include (apart from the
.graphql
files which I can't make public).The text was updated successfully, but these errors were encountered: