Skip to content
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

FIX: Incorrect Content-Type for apollo-server-adonis #910

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All of the packages in the `apollo-server` repo are released with the same version numbers, so a new version of a particular package might not represent an actual change to that package. We generally try to mark changes that affect only one web server integration package with that package name, and don't specify package names for changes that affect most of the packages or which affect shared core packages.

### vNEXT

* `apollo-server-adonis`: The `Content-type` of an operation response will now be correctly set to `application/json`.

### v1.3.4

* Upgrade to `apollo-cache-control@0.1.0` and allow you to specify options to it (such as the new `defaultMaxAge`) by passing `cacheControl: {defaultMaxAge: 5}` instead of `cacheControl: true`.
Expand Down
3 changes: 2 additions & 1 deletion packages/apollo-server-adonis/src/adonisApollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export function graphqlAdonis(
query,
}).then(
gqlResponse => {
response.json(gqlResponse);
response.type('application/json');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tweaking that, @CaptainJojo.

One last question: Do you know if the Content-length is set automatically, or should we set it like we do for express? If it's not set, it would be beneficial for it to be there!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think is set automatically, they are not option in adonis :)

response.send(gqlResponse);
},
(error: HttpQueryError) => {
if ('HttpQueryError' !== error.name) {
Expand Down