Skip to content

Commit

Permalink
Revert "Fix query batching for single queries for hapi integration. (a…
Browse files Browse the repository at this point in the history
…pollographql#123)"

This reverts commit 64cd806.
  • Loading branch information
helfer committed Sep 6, 2016
1 parent ce151ab commit 7b42c33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
3 changes: 0 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
* Support adding parsed operations to the OperationStore. ([@nnance](https://github.com/nnance))
* Expose ApolloOptions as part of the public API.

### vNEXT
* Fixed query batching with hapi integration. [PR #123](https://github.com/apollostack/apollo-server/pull/123)

### v0.2.5
* Made promise compatible with fibers ([@benjamn](https://github.com/benjamn) in [#92](https://github.com/apollostack/apollo-server/pull/92))

Expand Down
6 changes: 3 additions & 3 deletions src/integrations/hapiApollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export class ApolloHAPI {
return;
}

const {isBatch, responses} = await processQuery(request.payload, optionsObject);
const responses = await processQuery(request.payload, optionsObject);

if (isBatch) {
if (responses.length > 1) {
reply(responses);
} else {
const gqlResponse = responses[0];
Expand Down Expand Up @@ -137,7 +137,7 @@ async function processQuery(body, optionsObject) {
responses.push({ errors: [formatErrorFn(e)] });
}
}
return {isBatch, responses};
return responses;
}

function isOptionsFunction(arg: ApolloOptions | HAPIOptionsFunction): arg is HAPIOptionsFunction {
Expand Down
24 changes: 0 additions & 24 deletions src/integrations/integrations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,30 +283,6 @@ export default (createApp: CreateAppFunc, destroyApp?: DestroyAppFunc) => {
});
});

it('can handle batch requests', () => {
app = createApp();
const expected = [
{
data: {
testString: 'it works',
},
},
];
const req = request(app)
.post('/graphql')
.send([{
query: `
query test($echo: String){ testArgument(echo: $echo) }
query test2{ testString }`,
variables: { echo: 'world' },
operationName: 'test2',
}]);
return req.then((res) => {
expect(res.status).to.equal(200);
return expect(res.body).to.deep.equal(expected);
});
});

it('can handle a request with a mutation', () => {
app = createApp();
const expected = {
Expand Down

0 comments on commit 7b42c33

Please sign in to comment.