Skip to content

Commit

Permalink
Maintain use of context.done(), but use isRaw instead.
Browse files Browse the repository at this point in the history
Per the Azure documentation regarding the response object available at:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node#response-object
  • Loading branch information
abernix committed Apr 17, 2018
1 parent 29cc228 commit 98348a3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/apollo-server-azure-functions/src/azureFunctionsApollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,16 @@ export function graphqlAzureFunctions(

return runHttpQuery([httpContext, request], queryRequest)
.then(gqlResponse => {
httpContext.res.setHeader('Content-Type', 'application/json');
httpContext.res.raw(gqlResponse);
const result = {
status: HttpStatusCodes.OK,
headers: {
'Content-Type': 'application/json',
},
body: gqlResponse,
isRaw: true,
};
httpContext.res = result;
httpContext.done(null, result);
})
.catch(error => {
const result = {
Expand Down

0 comments on commit 98348a3

Please sign in to comment.