-
Notifications
You must be signed in to change notification settings - Fork 131
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
GraphQLError { message: 'Cannot read property \'req\' of undefined' .... #11
Comments
are you creating a dummy req here https://github.com/benawad/type-graphql-series/blob/master/src/test-utils/gCall.ts#L24 |
No I didn't! Wonder how I missed that one, sorry. Think I should watch the video again. ;) Thanks for your help! |
I have another question. Thanks and regards, Wilco |
what trouble are you having passing an enum value in? |
I have the following test:
I get the following error:
I also tried passing the values directly like
and
The enum is:
Regards |
so you have a typescript enum not a graphql one? |
Ehh, I don't know, I followed the documentation from Type-GraphQL |
and I assume your calling registerEnumType I would think passing it in as a string would work |
Yes, I am calling regards |
This way it's working!
regards Wilco |
Nice! |
Hello Ben,
Great tutorial!
My jest tests are failing with the following error:
It seems to go wrong on
@Ctx() { req }: IMyContext,
in the resolvers. Likereq
doesn't exist in Ctx.It only happens with tests. Running the application everything is working fine.
Thanks and regards,
Wilco
The text was updated successfully, but these errors were encountered: