-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
I have a valid Query that passes with tester.test however when I tester.mock with a fixture, then I'm seeing:
TypeError: Cannot read property 'type' of undefined
at validateFixture (node_modules/easygraphql-tester/utils/fixture.js:50:27)
at validateFixture (node_modules/easygraphql-tester/utils/fixture.js:100:19)
I debugged and it appears the issue is related to a simple name of type String which the mocker has no selectedType, hence the error at this line: https://github.com/EasyGraphQL/easygraphql-tester/blob/master/utils/fixture.js#L46
if (schema[selectedType.type]) {
If I simply add a null check, all my tests pass:
if (selectedType && schema[selectedType.type]) {
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
Metadata
Metadata
Assignees
Labels
No labels