mirror of
https://github.com/vale981/apollo-server
synced 2025-03-06 10:11:40 -05:00
Merge remote-tracking branch 'apollostack/master' into catch-formatError
This commit is contained in:
commit
27cfded665
2 changed files with 13 additions and 1 deletions
|
@ -29,7 +29,7 @@ const apolloHapi: IRegister = function(server: Server, options: HapiPluginOption
|
|||
|
||||
const config = Object.assign(options.route || {}, {
|
||||
plugins: {
|
||||
graphql: options.apolloOptions,
|
||||
graphql: isOptionsFunction(options.apolloOptions) ? options.apolloOptions : () => options.apolloOptions,
|
||||
},
|
||||
pre: [{
|
||||
assign: 'isBatch',
|
||||
|
|
|
@ -6,6 +6,7 @@ import {
|
|||
GraphQLObjectType,
|
||||
GraphQLString,
|
||||
GraphQLError,
|
||||
introspectionQuery,
|
||||
BREAK,
|
||||
} from 'graphql';
|
||||
|
||||
|
@ -261,6 +262,17 @@ export default (createApp: CreateAppFunc, destroyApp?: DestroyAppFunc) => {
|
|||
});
|
||||
});
|
||||
|
||||
it('can handle introspection request', () => {
|
||||
app = createApp();
|
||||
const req = request(app)
|
||||
.post('/graphql')
|
||||
.send({query: introspectionQuery});
|
||||
return req.then((res) => {
|
||||
expect(res.status).to.equal(200);
|
||||
return expect(res.body.data.__schema.types[0].fields[0].name).to.equal('testString');
|
||||
});
|
||||
});
|
||||
|
||||
it('can handle batch requests', () => {
|
||||
app = createApp();
|
||||
const expected = [
|
||||
|
|
Loading…
Add table
Reference in a new issue