You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @MichalLytek ,
I tried to make a GraphQL endpoint which accepts a text file in a NestJS app. However, I got the following error when I actually uploaded a text file to the endpoint via Altair:
"POST body missing, invalid Content-Type, or JSON object has no keys."
I'd like to solve this problem. If you shed some lights on it, I would really appreciate it.
(And I'm sorry in advance if I overlook something obvious)
I made it sure that I could upload a file to a endpoint, if I use @nestjs/graphql instead of type-graphql. So I think it's due to type-graphql or typegraphql-nestjs.
Environment
I use M1 macbook and node v16.14.0, run the app in local(without using Docker).
The whole dependencies in package.json is the following:
Problem
Hi @MichalLytek ,
I tried to make a GraphQL endpoint which accepts a text file in a NestJS app. However, I got the following error when I actually uploaded a text file to the endpoint via Altair:
I'd like to solve this problem. If you shed some lights on it, I would really appreciate it.
(And I'm sorry in advance if I overlook something obvious)
Expected behavior
It's suppose to return the content of text file.
How to reproduce
The query I sent from Altair is the following:
I sent the above query, setting Content-type header to application/octet-stream.
When I set it to application/json, the error message changed:
The resolver I made was the following:
The content of type.ts is the following.
The whole (super small) repository is the following, for what it's worth.
nestjs-typegraphql-upload
What I tried to solve the problem
I made it sure that I could upload a file to a endpoint, if I use @nestjs/graphql instead of type-graphql. So I think it's due to type-graphql or typegraphql-nestjs.
Environment
I use M1 macbook and node v16.14.0, run the app in local(without using Docker).
The whole dependencies in package.json is the following:
The text was updated successfully, but these errors were encountered: