Skip to content

Commit

Permalink
Merge branch 'master' into greenkeeper/flow-bin-0.36.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leebyron committed Dec 9, 2016
2 parents 887df34 + 18db1d6 commit 4322f9c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -46,7 +46,7 @@
"babel-plugin-transform-class-properties": "6.19.0",
"babel-plugin-transform-es2015-arrow-functions": "6.8.0",
"babel-plugin-transform-es2015-block-scoped-functions": "6.8.0",
"babel-plugin-transform-es2015-block-scoping": "6.18.0",
"babel-plugin-transform-es2015-block-scoping": "6.20.0",
"babel-plugin-transform-es2015-classes": "6.18.0",
"babel-plugin-transform-es2015-computed-properties": "6.8.0",
"babel-plugin-transform-es2015-destructuring": "6.19.0",
Expand All @@ -61,17 +61,17 @@
"babel-plugin-transform-es2015-template-literals": "6.8.0",
"babel-plugin-transform-flow-strip-types": "6.18.0",
"babel-plugin-transform-object-rest-spread": "6.19.0",
"babel-plugin-transform-regenerator": "6.16.1",
"babel-plugin-transform-regenerator": "6.20.0",
"chai": "3.5.0",
"chai-json-equal": "0.0.1",
"chai-subset": "1.3.0",
"coveralls": "2.11.15",
"eslint": "3.10.2",
"eslint": "3.12.0",
"eslint-plugin-babel": "4.0.0",
"eslint-plugin-flowtype": "2.25.0",
"eslint-plugin-flowtype": "2.29.1",
"flow-bin": "0.36.0",
"isparta": "4.0.0",
"mocha": "3.1.2",
"mocha": "3.2.0",
"sane": "1.4.1"
}
}
15 changes: 15 additions & 0 deletions src/execution/__tests__/executor-test.js
Expand Up @@ -23,6 +23,21 @@ import {
} from '../../type';

describe('Execute: Handles basic execution tasks', () => {
it('throws if no document is provided', () => {
const schema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'Type',
fields: {
a: { type: GraphQLString },
}
})
});

expect(() => execute(schema, null)).to.throw(
'Must provide document'
);
});

it('executes arbitrary code', async () => {
const data = {
a() { return 'Apple'; },
Expand Down
1 change: 1 addition & 0 deletions src/execution/execute.js
Expand Up @@ -121,6 +121,7 @@ export function execute(
operationName?: ?string
): Promise<ExecutionResult> {
invariant(schema, 'Must provide schema');
invariant(document, 'Must provide document');
invariant(
schema instanceof GraphQLSchema,
'Schema must be an instance of GraphQLSchema. Also ensure that there are ' +
Expand Down

0 comments on commit 4322f9c

Please sign in to comment.