-
Notifications
You must be signed in to change notification settings - Fork 34
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 'type' of undefined #142
Comments
Thanks for creating this issue! can you share a quick example to reproduce it please! thanks! |
@estrada9166 Sure thing, here it is: https://github.com/engineersamuel/easygraphqlrepro with instructions. |
Thanks for sharing it! what I can notice is that you are missing on the GraphQL schema, the field If you update it for - it may work type StorageDirectory {
name: String!
storageAccountName: String!
files(sampleSize: Int): [StorageFile]
} Definitely something that can be improves is the error message in this case in case you want to open a PR! |
Ahhh, great catch! Not sure on my bandwidth for a PR here, but let's leave this open and I'll try to get to it. |
I have a valid Query that passes with
tester.test
however when Itester.mock
with a fixture, then I'm seeing:I debugged and it appears the issue is related to a simple
name
of typeString
which the mocker has noselectedType
, hence the error at this line: https://github.com/EasyGraphQL/easygraphql-tester/blob/master/utils/fixture.js#L46If I simply add a null check, all my tests pass:
I'm happy to open a PR here, but I'd first want a core dev here to weigh in on what might be the issue and if this would be a valid check to simply add a null check on
selectedType
The text was updated successfully, but these errors were encountered: