benawad / type-graphql-series

Typescript GraphQL Server built with TypeGraphQL
326 stars 129 forks source link

Context is empty when File Uploads #16

Open ssdk86 opened 5 years ago

ssdk86 commented 5 years ago

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?

benawad commented 5 years ago

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

ssdk86 commented 5 years ago

@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?

ssdk86 commented 5 years ago

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

benawad commented 5 years ago

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