benawad/type-graphql-series

Context is empty when File Uploads

Opened this issue · 4 comments

Hi Ben, Thanks for a Great tutorial!
Have a question according to video File Uploads TypeGraphQL https://www.youtube.com/watch?v=s35EmAn9Zl8

So in addProfilePicture we cannot use @UseMiddleware(isAuth, logger) because @ctx() ctx: MyContext is empty? it is possible to send context?

I don't think the context should be empty, is it empty in your resolver too?

@benawad, yes, it is empty in my resolver. And when I testing query from graphql playground (without GraphQLUpload @arg) ctx is NOT empty. Maybe we have that resault because PostMan cannot send Context since it(postman) have not access to it?

@benawad, sorry I incorrectly described the problem. context is not empty. empty cookies that I set in ctx.req.cookies

cookies work with file uploads, so there's something slightly off with your setup